Stars are large balls of gas. They are formed as gravity pulls large clouds of dust and gas (nebula) together. Protostars form as this dust and gas is compressed together further by gravity. Eventually, the pressure inside the core rises as particles begin to move faster, enough for the temperature to exceed 15 million.