Saying we don't know is kinda dumb though, farming allows a population group to massively outperform a hunter gatherer group in terms of food and energy collected over a year, this allows them to have more children, and results in fewer deaths due to accidents while hunting. Farming also means fewer people are required for the same amount of food intake leaving more people free to do other things like develop tools and weapons
This all snowballs resulting in massive growth that allows the farming group to kill off or absorb any group that doesn't farm.
Same as natural selection/evolution, random choices/changes occur and the ones that lead to more children are the ones that last 1000s of years.