Tomatoes are a terrible example. Ripe tomatoes damage very easily so tomatoes going to grocers are picked green and then reddened by exposing them to ethylene gas. This minimally affects flavor but causes the tomato to appear "ripe".
If buying from farmers (not distributors) at your farmers market then those tomatoes were most likely ripened in the field then picked rather than gassed which is why they taste much better.