Farming led to increased social complexity because farming creates food surpluses.
In a hunter-gatherer society, there is no surplus food. Everyone has to participate in gathering food. When agriculture develops, there comes to be surplus food. An individual farmer can produce more than enough to feed him or her self. When this happens, some people no longer have to farm. They can become artisans or priests or government officials. This leads to a more complex society because people who do not have to spend their time producing food can play other roles that allow such a society to exist.