Rarity legend:

Common. (Dungeon drops, quest rewards, craftables etc.) Requires some time. (BFA socketed dungeon drops, Epoch Hunter drops etc.) Rare. (Very rare items that require a lot of grinding. BoEs for example.) Non existent/GF'd.

How are items sorted?

Items are sorted by rarity.
BFA/WoD rare drop/chest > Quest reward > Dungeon drop > Hard to get dungeon drops (Epoch, BFA socket procs) > Draenor apexis(daily) rare drop with socket > drop > World BoEs