

A star is formed when a large amount of gas (mostly hydrogen) starts to collapse in on itself due to its high gravitational attraction. As it contracts the atoms of the gas collide with each other more and more frequently and at greater and greater speeds--the gas heats up. Eventually, the gas will be so hot that when the hydrogen atoms collide they no longer bounce off each other, but instead coalesce to form helium. The heat thus released in this reaction, which is like a controlled hydrogen bomb explosion is what makes the star shine.