my guess is they ate fruit with seeds.
pooped.
saw sprout eventually growing out of soil and poop.
put 2 and 2 together.
We can only wonder about this, but unfortunately we will never know how did this happen in reality, unless someone will make a time machine. I agree with some people from above, that most likely humanity discovered this by accident and this information spread between them. Now we can enjoy gardening and growing fruits, vegetables in many different ways. I want to transform my backyard in a small garden as well. There was only tall grass which I mowed using a tool from this list https://www.growgardener.com, and now I can’t wait to see what will be the first results.