Stars are formed by gravitational contraction from vast clouds of galactic gas and dust. Star forming clouds are thousands of times denser than the normal interstellar gas. They have a density going up to 1000 hydrogen atoms per cubic centimetre.
The current theory of evolution (life of of stars) is based on the theory of their internal structure and sources of stellar energy.
The life of a star is spread over a billions of years. Stars start life as condensing masses of gas. As condensation progresses, individual atoms are drawn towards the centre by force of gravity. They pick up speed as they fall to the centre.
The nuclear reaction in a star is called Nuclear Fusion which goes on in all stars, all the time.
When the hydrogen in a star is converted into heavier atoms like helium, the density of the star increases manifold. The core of a dying star contains the densest matter in the Universe.
The ultimate destiny of a star is that it will turn into one of three things according to its mass:
If the star is about the mass of the Sun or less than that, it will turn into White Dwarfs.
If the star is bigger than the Sun but not more than twice as big, it will torn into a Neutron star or Pulsar.
If the star is many times bigger then the Sun, it will turn into Black hole.