In uncooked rice, starch is a semicrystalline structure arranged into granules. Generally, amylopectin makes up the crystalline component while amylose is dispersed throughout.
The linear molecules of amylose, and the ends of the long branches of amylopectin, form helical structures, both alone and entwined together. When these structures pack together, they create the ordered crystalline regions within the granules.
When rice is cooked, starch granules begin to absorb water and swell, like a balloon. As the temperature rises the granules continue to absorb more water until they reach their maximum volume, called the gelatinisation temperature. It is at this point that the granule bursts and amylose molecules leach into the surrounding water, which causes rice grains to stick together.
Check out this great video which demonstrates this phenomenon
Higher amylose content delays swelling and increases the gelatinisation temperature. Varieties of long-grain rice have a gelatinisation temperature above 70°C, while waxy short-grain rice gelatinises at 62°C. Because of this granules in short-grain rice are more likely to burst while the granules in long-grain rice tend to remain intact after cooking.
This is the reason why long grain rice cooks dry and firm while short-grain rice is sticky.