My initial guess was it is due to absorption of water during cooking (role of heat is probably to accelerate this process). So to verify this I have left uncooked rice in water for two days but so far it hasn't softened noticably. May be for sufficient absorption of water for softening I have to leave it longer. Or may be my initial hypothesis is wrong altogether.
Short answer Hydrolysis
Cooking shortens many molecules, particularly carbohydrates and proteins although almost anything long is affected. By heating them in a aqueous environment (many foods supply their own water) we are inducing billions of hydrolysis reactions. This chops up long polymers into shorter ones.For proteins heat also causes them to unwind which makes them easier to digest. In effect we are outsourcing a major portion of the digestion. This is why cooking is believed to have evolved as a behavior in the first place – it greatly increases the nutrient availability of the food by putting it in a much more easily digested state. Without heat the number of hydrolysis reactions is negligible, although a few things like extreme PH or infusion of enzymes can be substituted for heat.
For most edible molecules shortening them also makes them softer (most macronutrients are polymers, after all) which is an additional benefit. This is also why there is a balance in cooking, cook too long or at too high a temprature and you start to get lots of other kinds of reactions that produce new indigestible molecules. Cook too short or too low a temp and you get few hydrolysis reactions and it essentially does nothing. Hydrolysis is one of the reasons cooking will also dry out foods, since water is being used up in hydrolysis.
The main reason to cook food is to break the cell wall. All plant cells have a cell wall, which is hard and tough. By cooking it you break the cell wall and your food will be softer and easier to digest.
For your rice example, of course the grain will need to absorb water to soften. By cooking it you break the cell wall, which is still intact in your uncooked rice in water. The cell wall here prevents the uncooked rice grain to absorb as much water as cooked grains (in which the cell wall was broken).