Understanding plants in ancient times were crucial even during Prophet Muhammed (PBUH) due to lack of knowledge advancement in any country that they no one knows that both male and female organs exists in plants.
This has been specified audibly in chapter Taa Haa:
“(God is the One who) sent down rain from the sky and with it brought forth a variety of plants in pairs.” Qur’an, 20:53
Abiding to this quote we can see that fruits are produced by plants with sexual behaviours. Whereas fruits like bananas grow in unfertilized flowers.
This fact has been mentioned multiple times as seen in another chapter ar-Ra‘d
“… and of all fruits (God) placed (on the earth) two pairs.” Qur’an, 13:3