How do major attributes like agility compare to minor attributes like versatility

For a long time now, Blizzard has tried to make it so that primary stats completely trump secondary stats, and that in effect means item level trumps everything. They did not completely succeed (whether that is good or bad is a matter of opinion).

For players who do not wish to run challenging content (Mythic raids, High M+ keys), this rule of thumb should be enough to progress the character.

The conversion of a stat into its effect changes based on level. According to the wiki, conversions for BFA are as follows:

+-----------------+--------------------------+----------+----------+----------+----------+----------+-----------+-----------+-----------+
|     Rating      |       Effect             | Level 60 | Level 70 | Level 80 | Level 85 | Level 90 | Level 100 | Level 110 | Level 120 |
+-----------------+--------------------------+----------+----------+----------+----------+----------+-----------+-----------+-----------+
| Critical strike | 1% crit chance           | 8.5      | 9.71     | 11.18    | 12.02    | 12.94    | 15.07     | 17.62     |        72 |
| Haste           | 1% haste                 | 8.03     | 9.17     | 10.56    | 11.35    | 12.22    | 14.23     | 16.64     |        68 |
| Mastery         | 1 Mastery point          | 8.5      | 9.71     | 11.18    | 12.02    | 12.94    | 15.07     | 17.62     |        72 |
| Versatility     | 1% dmg/heal 0.5% dmg red | 10.03    | 11.47    | 13.2     | 14.19    | 15.28    | 17.79     | 20.80     |        85 |
+-----------------+--------------------------+----------+----------+----------+----------+----------+-----------+-----------+-----------+

Furthermore, at Level 120, 1 stamina converts to 20 hp.

This, however, doesn't really answer your question, and it is not really answerable in general form. For each class and specialization, theorycrafters come up with the "best" stat distribution.

According to Noxicc, stat weights for feral druids are as follows:

Agility [9.06] > Haste [7.56] > Mastery [6.06] >= Crit [5.68] >= Versatility [5.31]

Which means 1 agility is worth ~1.7 versatility for feral druids at level 120.

Those are however generalized results, intended to work for most item levels, talents and trinkets. depending of what exactly you are wearing, what type of encounter you are up against etc., this might vary.

You can get more accurate quantitative stat weights for your class & specc by using a good simulation software, such as Raidbots or Simcraft. Both are excellent tools to find out which gear pieces are better, considering your current gear, specialization, talents and even artifact traits (azerite traits for BfA).

Gear in WoW is complex enough that there is no single answer to "what piece of gear is better".

Rules of thumb:

  • If you do not wish to do challenging content, primary stats are better than everything else. Just use the items with the highest item level (with the correct armour type for your class, e.g. leather for druids, cloth for warlocks etc.)

  • If you do raiding (normal, heroic) and low-level M+ keys, stick with the stat priorities the guides (e.g. from Icy Veins, Noxicc, WoWHead or else) suggest

  • If you want to push mythic raids or high M+ keys (25+ end of Legion), use a proper simulation tool to find out which piece of gear is better for what situation (e.g. AE vs ST, M+ vs raids).