Gravity pulls gas together to make stars. As gas falls inward it gets denser and hotter. If the lump is small, it may become a brown dwarf or a big planet. If it is heavy enough, the center gets hot enough for nuclear fusion and a star is born. Inside a steady star, hydrostatic equilibrium means gravity pulls inward while pressure from heat pushes outward and they balance.
When stars use up their fuel, different endings happen: small cores cool into white dwarfs, bigger ones can become neutron stars, and the most massive can collapse into a black hole. Colliding stars and collapsing cores also send out gravitational waves, ripples in space-time that scientists can now detect. On the largest scale, invisible dark matter acts by gravity to pull gas into big halos, helping galaxies form and grow.