About the particular example:
Wheat and other grains have high nutrition value and dandelions not. You need to eat several kilo of dandelion to cover your basic calorie needs. 40Cal/100g, that is 400Cal /kg. You need to eat 5 kg if you are an office worker sitting all the day. But most probably you would be pretty sick in the first day if you can finish that, and you wouldn't be able to digest even that amount of calory due to the enormous amount of fiber it has in it.
Also, dandelion do not grow everywhere, hard to collect, even harder to store. Most leafy veggies are originally poisonous, and needed domestication + cooking to make them edible. Wheat, corn etc are practically grass. Saying that dandelion is more common than grass is kind of arguable.
All agricultural society based on domestication of grains and starchy roots/vegetables. Corn, potato, rice, wheat, malt etc. For the simple reason people needed calorie and protein. Dandelion has neither. Those people were not looking for loosing weight fast or something healthy and hipster to eat with their pizza. They were looking for survival.