I would imagine it has something to do with the end of the ice age. I've seen it said developed about 12000 years ago in the fertile crescant and spread from there. But I also read that it probably developed in many places around the world around 12000 years ago for reasons other than the ice age ending. Perhaps someone with more knowledge on this can clear things up a bit.
Hi, while it's possible that you'll get an answer here, for questions about prehistory, it's worth x-posting to our sister sub /r/AskAnthropology. There are some anthropologists here, but there are more over there, and with greater focus on earlier time periods.