Fruit tastes sweet because of the natural sugars contained within its flesh. Simple sugars, such as fructose, have a sweetness greater than table sugar and provide the body with a natural energy source. Most ripe fruits are a combination of water, sugar, fiber, minerals, vitamins and enzymes. The riper the fruit, the sweeter it is until it begins to decompose.
Though ripe fruits contain natural sugars, these sugars do not exist in high quantities in unripe fruit. While unripe fruit still contains water, fiber, vitamins, minerals and enzymes, it also contains starch, which is not sweet, does not have a lot of flavor and has a mealy texture. Additionally, unripe fruit has thicker cell walls than those of ripe fruit, which can make the unripe fruit chewy or hard. The high starch content in unripe fruit is why it does not have the same rich flavor as ripe fruit.
During the ripening process, fruit produces a gas called ethylene. This gas signals the production of enzymes that break down both pectin, or the "glue" that holds fruit cells together, and cell walls, a process that softens the fruit, as well as turn the starch into sugar. These enzymes also produce pigments that cause the fruit to change color and break down acids that cause bitterness.
Ethylene not only occurs as part of the natural ripening process, but also takes place when a piece of fruit is damaged. This production of ethylene by damaged fruit is why damaged fruit affects the ripening process of surrounding fruit. Cut or bruised fruit can force surrounding fruit to begin the ripening process, which enhances their natural sweetness.