Tomatoes that grow on the ground will not ripen because they are not exposed enough to the sun or because their leaves are too moist from rain. Tomatoes that grow in pots may be affected by fungus, which will prevent them from ripening.
Tomato fruits are green because they do not contain a lot of sugar and the cells in their epidermal layer absorb light, preventing them from turning brown. The cells need to break down, but they cannot break down while they are still green. As soon as the fruit starts to change color, then it will also start to ripen.