Stars that have exhausted their supply of hydrogen in regions where thermonuclear reactions are important enter a collapsing phase. If the mass of the star exceeds Chandrasekhar's limit collapse will continue until rotational instability occurs. Rotational instability enables the star to throw material off to infinity. This process continues until the mass of the remaining stellar nucleus becomes of the order of, or less than Chandrasekhar's limit. The nucleus can then attain a white dwarf equilibrium state. The temperature generated at the centre of a collapsing star is considered and it is shown that values sufficiently high for statistical equilibrium to exist between the elements must occur. The relative abundances of the elements can then be worked out from the equations of statistical mechanics. These equations are considered in detail and it is shown that a roughly uniform abundance of the elements over the whole of the periodic table can be obtained. The process of rotational instability enables the heavy elements built up in collapsing stars to be distributed in interstellar space. The results arising from the discussion of the formation of heavy elements lead to a natural explanation of the difference between novae and supernovae.