Sunshine is the other big variable. Most fruit will only get sweet during ripening if it's receiving enough sunlight. This is why red grapes are seldom grown in northern latitudes - their dark skin blocks sunlight and prevents them from sweetening during ripening.