From those precursors of food production already practiced by hunter-gatherers, it developed stepwise. Not all the necessary techniques were developed within a short time, and not all the wild plants and animals that were eventually domesticated in a given area were domesticated simultaneously. Even in the cases of most rapid independent development of food production from a hunting-gathering lifestyle, it took thousands of years to shift from complete dependence on wild foods to a diet with very few wild foods. In early stages of food production, people simultaneously collected wild foods and raised cultivated ones, and diverse types of collecting activities diminished in importance at different times as reliance on crops increased.
The underlying reason why this transition was piecemeal is that food production systems evolved as a result of the accumulation of many separate decisions about allocation time and effort. Foraging humans, like foraging animals, have only finite time and energy, which they can spend in various ways. We can picture an incipient farmer waking up and asking: Shall I spend today hoeing my garden (predictably yielding a lot of vegetables several months from now), gathering shellfish (predictably yielding a little meat today)? or hunting deer (yielding possibly a lot of meat today, but more likely nothing)? Human and animal foragers are constantly prioritizing and making effort-allocation decisions, even if only unconsciously. The concentrate first on favorite foods, or ones that yield the highest payoff. If these are unavailable, they shift to less and less preferred foods. [Guns, Germs, and Steel. Chapter 6: To Farm or Not to Farm. Page 107. Jared Diamond. 1999]
A lot of words.
Luckily, any economics student who has his or her bases covered will understand this as in one way or the other. Simple! We can thank the marginal revolution that began in the late 19th century for that. Marginal revolution also solved the paradox of value. Indeed, marginalism is the foundation of modern microeconomics, regardless of your cup of tea.
And oh, did you know that the marginal revolution also made Marxian economics in its original interpretation completely obsolete?