Star formation is the process in which large clouds of gas in space collapse and form a new star. The size of the star that forms determines what will happen to the star after it dies. During their lives, stars are constantly giving off heat, light, and energy from the process of nuclear fusion occurring inside them. The sun is a perfect example of a star clearly visible from Earth. It is close enough to appear large even though it is only a medium sized star, and its heat and light allow plants and animals on the planet to thrive.
For star formation to occur, the pressure inside a cloud of gas must be too weak to support the cloud. Jeans mass is a term for the mass that a specific cloud must reach before it collapses in on itself. When this mass is reached, the cloud will then collapse from its own weight, and smaller clumps of gas break off. These clumps have a gravitational pull and begin to attract more gas and particles of dust floating around them. This process continues until enough material has been pulled in, creating a protostar.
The protostar continues to grow and the star formation process continues until it hits the point where nuclear fusion begins. The nuclei of atoms in the protostar are forced together and fuse, releasing energy. The star formation process is then complete and the star has reached the main part of its life. The new star will continue to produce heat, light, and energy until it can no longer maintain the balance between its own inward gravitational pull and the outward expansion of gas. The size of the star, controlled mostly by the the strength of its gravitational pull and its overall mass during star formation, determines what happens to it at its death.
Once the star reaches old age, it expands to form a red giant. This expansion occurs when a star is losing the battle to keep its equilibrium and balance, and eventually will either shrink into a white dwarf star or form a black hole. The white dwarfs are slowly cooling down, yet still give off light. The formation of a black hole, formed from the death of extremely large stars, is thought to be caused by the star collapsing in on itself. Black holes are still largely a mystery, however, and scientists have a lot to learn about them and how they work.