Stars are composed of hot gases in which the atoms and molecules are almost completely ionized in the interior (the state of matter called a plasma). The question of whether fusion reactions can occur in this plasma is primarily one of the density/pressure(*) and the temperature of the gas, because the density controls the number of collisions and the temperature controls their average energy. (*)Please note that for a fixed volume and temperature, the density and pressure are directly related, we may also use the pressure instead of the density as a variable.
The higher the electric charges of the interacting nuclei, the greater the Coulomb repulsive force, hence the higher the kinetic energy and temperature required before reactions occur. Highly charged nuclei are the more massive, so reactions between light elements occur at lower temperature than reactions between heavy elements. But, in other words, classical mechanics prevents the two protons from fusing because they will never have enough energy to overcome the Coulomb repulsion.
The energy of the Coulomb barrier is given by:
Where Z is the atomic number for each particle, in this case, Z=1 for 2 protons. r0 is the radius at which nuclear attraction overcomes Coulomb repulsion, r0 ~ 10^-15m. This energy is thus approximately equal to 1MeV for 2 protons.
In the kinetic theory of gases, all gas particles have kinetic energy due to their motions as they bounce around. Temperature is a measure of this microscopic kinetic energy. The kinetic energy of any moving particle is 1/2mv2, where m is the particle mass and v is its velocity. Maxwell and Boltzmann (M&B) deduced that the mean kinetic energy is proportional to T. This statement is usually written E = 1/2 mv2 = 3/2 kT
In this equation, k is a fundamental constant called the Boltzmann constant, which has the tiny value of 1.38 × 10^-23 Joules per Kelvin. The temperature is proportional to the square of the average velocity and it is proportional to the mass of the particle.
However, in the solar core, the temperature is Tc ∼ 1.5×10^7 K. Then, with the M&B equation: E(= 3 / 2 kTc ) ~ 1keV, or ∼ 10^−3 Ec. That is, despite that the core is very hot, it is not hot enough to bring the protons close enough to trigger fusion, but only brings protons to within ∼ 10^3 r0 of each other. In other words, the protons are not close enough by a factor of 10^3!
George Gamow calculated that protons with 3 to 10 keV of energy (which there are plenty of in the Sun’s core) can overcome the Coulomb barrier (of 1 MeV) through a process of quantum tunneling or barrier penetration. It is (1) the low probability of this quantum tunneling, along with (2) the need for a weak interaction in order to fuse two protons into a deuterium nucleus, which are the two factors that make stars have lifetimes billions of years long!
The Coulomb barrier for charged particle reactions and the distribution of velocities implied by the kinetic theory of gases imply that there is a narrow range of energies where nuclear reactions involving charged nuclei occur in stars. This window is called the Gamow window. The peak is the product of the two curves decreasing in opposite directions: The probability for penetrating the Coulomb barrier decreases rapidly with decreasing energy (wave behavior and Energy = wavelength x frequency), but with M&B, at a given temperature the possibility of having a particle of high kinetic energy (and therefore high velocity for the particle behavior) decreases rapidly with increasing energy (because of E=mc^2 and mass resists to acceleration, that is, a change in velocity).
To conclude, the sum of these opposing effects produces an energy window for the nuclear reaction: only if the particles have energies approximately in this window can the reaction take place. This is a plot of the normalize probability (range between 0 and 1) on the Y-axis and the particle energies on the X-axis:
Source: Wikipedia Gamow window as starting point, but a lot of personal research, since this topic is often skipped in Astronomy text books.