Plants use fruits to spread their seeds and create new plants. The fruit is comparable to a womb in which the baby plant develops. When the seeds have developed, the fruit becomes sweet, encouraging animals to eat the fruit and scatter the seeds.
The fruit's flesh serves as protection and nutrition for the developing seeds. While the seeds are still too young to be spread, the fruit tastes sour. At this stage, the fruit is considered unripe. The bad taste discourages animals from eating the fruit before the seeds have finished growing.
After an animal eats the flesh of the fruit, the inedible seeds are often left behind. These seeds go on to produce new plants. Some fruits, such as nut kernels, taste delicious to encourage animals to hoard them underground. These nuts are then given a chance to sprout far from the original plant.
However, not all fruits evolve to be eaten. Some fruits are covered with burrs, spikes and hooks. These fruits are difficult to eat and tend to stick to fur and hair, which leads to the seeds being spread as the unwitting host carries them around. When they are picked out of the host's fur and left unharmed, they produce new plants.