Once the universe was created by the Big Bang, the only abundant elements present were hydrogen (H) and helium (He). These elements were not evenly distributed throughout space, and under the influence of gravity they began to "clump" to form more concentrated volumes. Evidence of this uneven distribution can be found in the anisotropies detected in the Cosmic Background Radiation (CMB) by the COBE satellite in the early 90's. These clumps would eventually form galaxies and stars, and through the internal processes by which a star "shines" higher mass elements were formed inside the stars. Upon the death of a star (in a nova or a supernova) these high mass elements, along with even more massive nuclei created during the nova or supernova, were thrown out into space to eventually become incorporated into another star or celestial body.
The conditions inside a star that allow the formation of the higher mass elements can be related to a pushing match between gravity and the energy released by the star. Gravity creates a force that would cause a star to shrink and collapse, but the energy released by nuclear reactions within the star flows outward, and produces thermal pressure that opposes gravity. When these two forces are balanced, the star maintains a particular size. But when there is some type of imbalance, the star (or some part of it) will expand or contract in response to the stronger of the two forces.
When the universe was first created, essentially all matter was in the form of two elements- hydrogen and helium. Their relative abundance (by weight) was 75% hydrogen and 25% helium. (This means that for every He nucleus there were 12 H nuclei/protons) They were not evenly distributed throughout space. This is critical, because this uneven distribution allowed gravity to act in the areas of higher concentration to initiate the "clumping" of matter. If everything were evenly spread out, nothing would have happened, for each atom would have been attracted evenly from all directions, and would have remained where it was relative to neighboring atoms. As a result of slight discrepancies in the distribution of matter, gravity was able to initiate the collapse of huge volumes of H and He into more concentrated areas of gas. These areas eventually would evolve to form galaxies. Within these areas, there was a second level of more concentrated clumping of H and He that would form stars, where the higher mass elements would be created.
In these more concentrated areas, as the clouds of H and He (called nebulas) collapsed, the atoms were speeding up as they were pulled toward the center by gravity. This caused two things to happen. First, the increase in the velocity of the atoms resulted in an increase in the temperature of the material. At some point, the temperature became high enough so that the material began to glow. Second, the atoms were becoming packed more tightly, increasing the density, and the frequency of collisions between atoms. As this happened, the mass of H and He became more spherical. At this stage the mass of H and He is called a protostar.
The temperature inside a star is not uniform. The central region (called the core) is the hottest, with the temperature decreasing as you move out toward the surface of the star. At some point, the temperature became high enough in the core of the protostar to form a phase of matter called a PLASMA. In a plasma, the electrons become separated from the nuclei, so instead of individual atoms, you have a "sea" of nuclei and electrons. This allows the nuclei of the atoms to interact with each other, which would not happen if each atom possessed its own electron cloud.
The temperature and density continued to increase until they reached what is called the "flash point." Up until this moment, all the collisions between nuclei were like marbles bouncing off each other. Each nucleus, having a positive charge, would only get so close to another nucleus before being pushed away by the electrostatic repulsion between both nuclei. Once the conditions reached the flash point, some of these collisions occurred in a manner (with the sufficient velocity and geometry) to allow the nuclei to get close enough to interact with each other. This allowed the STRONG NUCLEAR FORCE (strong force) to bind these smaller nuclei together, forming a more massive nucleus. This process is called FUSION. Regardless of which process occurs, once fusion of H has begun in the core of the star, what is happening is that H is being converted to He, and this is accompanied by a release of energy. During most of a star's lifetime this is the primary fusion reaction that powers the star. The outward flow of energy (thermal pressure) released balances the collapsing force of gravity, and this stabilizes the star's size.
As time passes, though, the fusion process causes He to accumulate in the core. The increase in the number of He nuclei begins to interfere with the H nuclei collisions and causes a reduction in the rate of H fusion (sometimes called "helium poisoning"). This reduces the thermal pressure, and the star will begin to contract.
The more massive He nuclei are drawn to the center of the core by gravity. As the He nuclei move toward the center of the core, the temperature and density there go up. With the formation of this central He core, the H fusion continues. This occurs in a layer surrounding the He core, where the He concentration is lower. This layer is referred to as a "shell." The rate of hydrogen burning is boosted due to the increase in temperature of the He core.
The He core continues to contract under the influence of gravity and draw in the He forming in the hydrogen shell. If the temperature reaches 100,000,000 K (which depends on the initial mass of the protostar) He burning can begin. This is where the He nuclei are able undergo fusion. This results in the formation of carbon nuclei through a series of reactions called the TRIPLE ALPHA PROCESS. The release of energy through the triple alpha process combines with the increased energy produced in the H shell to boost the thermal pressure of the core to the point where it overcomes gravity, and the size of the overall star increases. The increase in the surface area grows at a faster rate than the increase in released energy, so the surface actually cools even though the star is giving off more energy. This causes the star to glow red, and the star is referred to as a red giant. (Just to give you an idea of size, when our sun reaches the red giant stage, it will extend almost to where the earth is, having already vaporized Mercury and Venus).
At this point the star has a central core of He being fused into C, surrounded by a shell that has H being turned into He. As the C nuclei are produced, they are pulled toward the center, just as the He nuclei were earlier, and a C core is created. For an average-sized star, this is as far as it goes because of the mass of the star. There is not enough gravitational force (due to the lack of mass) in the star to allow the temperature and density to reach levels where C nuclei can fuse into heavier nuclei.
If a star had sufficient mass, enough C would accumulate eventually so that the temperature and density reach a point where C nuclei could be fused into Neon nuclei. This carbon burning core would be surrounded by two outer shells, the innermost burning He, and the outermost burning H. This pattern of the central core collapsing and increasing temperature continues until a further round of fusion occurs and more shells form. How many shells are eventually formed is dependent on the initial mass of the collapsing nebula. This is because the main force that produces conditions suitable for fusion to happen is gravity, and the mass of the star determines the force of gravity. If enough mass accumulates in a forming core, gravity will be able to create enough force to raise the temperature and density to levels where the next series of fusion reactions can take place. Therefore, the larger the mass of the protostar, the greater ability to form more shells during the lifetime of the star. This will also reduce the lifetime of the star since the increases in temperature also increase the fusion rates in the core and the surrounding shells, thus using up fuel even faster. Further cores/shells involve neon being converted to oxygen, oxygen fusing to silicon, and finally, silicon going to Ni (this product is radioactive and decays to form iron). Stars that reach this stage are called red supergiants. This is the limit to what a star can do (the reason why is mentioned later).
As the fusion process continues, the concentration of Fe increases in the core of the star, the core contracts, and the temperature increases again. However, when the temperature reaches a point where Fe can undergo nuclear reactions, they are different than the reactions that have previously taken place. Fe nuclei are the most stable of all atomic nuclei. Because of this, when they undergo nuclear reactions, they don't release energy, but absorb it. Therefore, there is no release of energy to balance the force of gravity. In fact, there is actually a decrease in the internal pressure that works with gravity to make the collapse of the core more intense. In this collapse, the Fe nuclei in the central portion of the core are broken down into alpha particles, protons, and neutrons and are compressed even further. But, they cannot be infinitely compressed. Eventually, the outer layers of material rebound off the compressed core and are thrown outward. This situation can be likened to a rubber ball on the ground that is struck with a hammer. Initially the hammer can compress the rubber ball because of its force, but eventually it is stopped by the density and pressure of the rubber ball reaching its limit, and is thrown back violently by the recoiling rubber ball, which itself will bounce off the surface because of this recoil. In the star, the outer layers of the core are like the hammer, and the core is the rubber ball. Following the collapse of the inner core, the outer layers of the star are pulled toward the center. This sets the stage for a tremendous collision between the recoiling core layers and the collapsing outermost layers. Under the extreme conditions of this collision, two things happen that lead to the formation of the heaviest elements. First, the temperature reaches levels that cannot be attained by even the most massive stars. This gives the nuclei present large kinetic energies, making them very reactive. Second, because of the breaking apart of the iron nuclei in the central core, there is a high concentration of neutrons (called the neutron flux) that are ejected from the core during the supernova. These neutrons are captured by surrounding nuclei, and then decay to a proton by emitting an electron and an antineutrino. Each captured neutron will cause the atomic number of that nucleus to go up by one upon its decay.
With the large neutron flux created during a supernova, this neutron capture/decay sequence can be repeated many times, adding protons to form increasingly more massive nuclei. These conditions exist for only a short time, but long enough to form the highest mass nuclei.
Because of this "rebound explosion", all the outer layers of the star, enriched with the higher mass nuclei, are blown off into space, and this material will later make its way into other nebulas to become incorporated into other stars, where the same cycle of events will be repeated. Each cycle uses up more of the H and He from the early universe and creates greater amounts of the higher mass elements.
There are a number of possible pathways for H fusion, but the primary reaction mechanisms are believed to be the PROTON-PROTON CHAIN (p-p chain), or the CARBON-NITROGEN-OXYGEN CYCLE (CNO cycle). Which mechanism is utilized depends on the conditions in the core of a particular star. The proton-proton chain occurs under milder conditions (lower temperature and pressure) than the carbon-nitrogen-oxygen cycle.