RpR, all major agricultural universities have done extensive research on this topic—Cornell, Texas A&M, UC Davis, etc—and the information is available if you're willing to slog through technical papers and studies. The reasons so many store-bought tomatoes are sub-standard is that many grower/shippers cut corners and pick too soon, the shipments are held in cool storage too long to delay ripening, and those that will ripen are often not kept long enough by the consumer to reach maximum sugar content. In addition, the varieties hybridized for commercial use are often developed for shipping durability, not taste. Other studies, just as extensive, have studied the optimum ripening temperature.
There is a point in the ripening process when the plant shuts off the connection between stalk and fruit. Literally, like turning of a water faucet. At that point
the plant no longer provides any nutrients at all to the fruit, but the fruit itself continues to develop sweetness and color whether it is on or off the vine. This is known as the "breaker stage." It varies somewhat by species, but it always takes place.
Here is an article that distills that process in understandable terms. It's long but readable. Read to the end.
https://www.gardenmyths.com/my...