Although there have been a number of events that have been called agricultural revolutions, I assume that you are asking about the first Agricultural Revolution. This revolution is also known as the Neolithic Revolution. This is the revolution in which people first came to engage in agriculture. In my answer, I will discuss the origins of this revolution.
First off, we should be aware that we do not know for certain why the Agricultural Revolution came about. Different people have different conjectures about the subject but there is no way of knowing the answer for sure. Since different texts/teachers can give different answers, it would be best for you to check your textbook and/or notes to see if there is a particular set of causes that you are supposed to know for your class. That said, let us look at some possible causes of the “invention” of agriculture.
One reason why agriculture might have come about was changes in climate. As the last Ice Age ended, the climate changed. Those changes might have made conditions that were better for plants, like wild grains, that could be domesticated. This would have made it easier for people to raise crops instead of gathering wild crops, thus helping agriculture to get started.
Another possible reason is that populations in some regions might have increased. If populations increase, it is harder for hunter-gatherers to find enough food to get by. In such conditions, hunter-gatherers might have started to try to experiment with agriculture. This would have allowed them to produce enough food to support the larger populations.
A third factor that has suggested as a cause of the Agricultural Revolution is the development of technology. As people created more technologies that could be used for agriculture, agriculture became more productive. For example, when people invented sickles, they came to be able to reap wild grain more quickly. This might have led them to experiment with planting the grain purposely. The same might have been true as they invented better ways to carry and store grain.
When we think about how the Agricultural Revolution began, we should realize that it did not simply happen because people suddenly decided to settle down and raise crops. Instead, it would have happened gradually. The people would have noticed that certain wild grains were becoming more plentiful, or that it was getting harder to find enough berries and wild animals to support their population. When they started to notice these things, they might have started to experiment with planting a few seeds near a place that they used as a settlement at times during the year. If that worked, they might have started planting more and eventually they might have become what we would think of as farmers. The process did not happen overnight.
Thus, we can say that the Agricultural Revolution came about as the result of various factors that made agriculture more possible and more necessary. These factors brought about a gradual process of change that ended with societies engaging in full-fledged agriculture.