The climate of the world had major changes around 12,00012,000 years ago. There was a shift to relatively warmer conditions. Grasslands developed in many areas. Plants and animals also developed in the meantime. Humans observed the places where edible plants were found, they wondered how seed broke off stalks, fell on the ground, and new plants sprouted from them. They became farmers due to these changes.
They also learnt how to get the attention of animals by taming them and providing them food. People tamed the wild ancestor of the dog. They also started rearing sheep, goat, cattle, etc. and this made them herders. Grasslands had allowed many animals which lived on grass to grow in number.