“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)?”
The purpose of the plant producing a fruit is so that the seeds can spread. In dandelions they flower and then grow white spreading their seeds in the wind. An apple tree grows a flower and then a fruit that contains the seeds that can spread, hopefully.
When a flower is pollinated the cells of the new seed multiply and slowly they form a seed. The ovary, the house for the seeds, stores the nutrients and energy needed for the seeds to grow. The ovary forms a wall, the flesh of the fruit or the shell of the nut. Which is why when we eat fruits we get energy and nutrients–the part we eat was the storage place for the seeds’ nutrients. But, is it worth it for the plant to produce fruit just to spread the seeds?
Well, yes. If they didn’t spread their seeds then there wouldn’t be any more of that kind of plant. However it takes so much nutrients, etc… and also energy that would perhaps be spent on some other part of the plant. And if you think about it, an apple tree’s seeds don’t get spread because we eat the apples. So unless we deliberately plant a apple seed, those seeds get thrown in the garbage.
In my opinion, the answer is just that the plant does it because if it didn’t the continuation of its species would stop. It’s not really a matter of choice.