What causes fruit to ripen?
Generally fruit ripens due to exposure to oxygen. During transit and storage some produce is set in oxygen deficient environments to control this effect. Various fruit contain chemicals (such as the hormone ethylene) that mediate ripening.
In most fruits, ripening is accomplished by the change of starches to sugar.