I took a course in college and it was the professor's contention that civilization (or humans forming villages and towns) that led to domestication of plants and animals as need and specialization made it economical.
I still think he was on to something. Who would spend all the time and effort to farm if you didn't have a market for your excess grain? Where would you store it? And stored grain is a depreciating asset, more so then than now.
And where the heck does corn/maize really come from? No one knows for sure even to this day. There is no wild corn, like there is every other grain. And how the heck did those people around Oaxaca really develop those thousands and thousands of different domesticated plants?
They're working on that question
MAIZE Project. Learn more about Maize (Corn): History, Genetics, Ecology, and other information.
MAIZE Project - Ancestors of Maize
As for the how of those devopments by the people around Oaxaca, take a look at what potatoes were like before and after men began to selectively breed them