Stars are being born as well as dying, but the rate varies greatly from galaxy to galaxy.
Stars form from huge clouds of dust and gas. If a cloud begins to contract because of its own gravity, its interior heats up as gravitational energy is converted to heat energy, reaching millions of degrees, and nuclear reactions begin that change one element into another, releasing energy.
The pressure tends to expand the cloud back out, but eventually equilibrium is reached. That is essentially what a star is, a mass of gas at equilibrium between inward pressure from gravity and outward pressure from nuclear reactions.
A star has a finite lifetime because it is burning fuel. For 90 percent of its life, it burns hydrogen into helium. When the hydrogen is used up, the pressure decreases, but gravity never disappears, so the star contracts until the temperature climbs again, this time reaching hundreds of millions of degrees, while reactions convert helium to carbon and oxygen.
The star can then remain stable for a briefer time. Eventually the star dies, when the reactions no longer produce energy, but only consume it.