Fruits are “expensive” for a plant to produce, in the sense that the plant must use a lot of nutrients, sugars, water and space to create something that the plant will ultimately “throw away.” Is it worth it (from the plant’s point of view)?
When a plant is creating a fruit it is like a protective barrier for the seed to ensure the seeds safety, and keeping the seed surrounded has a lot of benefits. While it acts as a protective barrier it also makes sure that the seed will be carried away from the original plant so that the seeds can be fertilized and blossom into a new plant. There are many ways that the seed can be passed on, one way is when humans pick the fruit we eat the fruit and discard the seed depending on where it lands it can be fertilized and grow. Another way that seeds can be fertilized is when an animal eats the fruit it gets passed on through the digestive system and discarded when the animal discards it’s waste and the seed is surrounded by fertilizer and can grow.
The tree is like a parent who wants their child to grow up and blossom, and the tree makes the fruit to ensure that their “child” will go on and become a new plant and also to ensure that they have children and their species can reproduce.