Lee Smolin, a leading theoretical physicist, points out in The Life of the Cosmos that stars are necessary for life. They are the energy sources that prevent everything from falling into a homogeneous thermal equilibrium, in which life as an entity that necessarily operates outside any thermal equilibrium could not exist.
He then says (here is the link to the chapter on stars):
"What is the probability that the world so created [with random values of the parameters] would contain stars? The answer is that the probability is incredibly small. This is such an important conclusion that I will take a few pages to explain why it is true. In fact the existence of stars rests on several delicate balances between the different forces in nature. These require that the parameters that govern how strongly these forces act be tuned just so. In many cases a small turn of the dial in one direction or another results in a world, not only without stars, but with much less structure than our universe."
He then discusses for several pages the parameters that need to be ‘just right’. Here is a brief summary:
1) Protons, neutrons, electrons and neutrinos interact via four basic forces. These are gravity, electromagnetism, and the strong and weak nuclear forces.
2) Newton’s gravitational constant is incredibly weak. This is vital for stars because the weaker gravity is, the more protons must be piled on top of each other before the pressure is strong enough to produce nuclear reactions. Stars are therefore so huge because the constant is so tiny. If they were not huge then they would not be able to burn for billions of years (they usually burn for 10 billion years). If it were stronger by only a factor of 10, stars would only burn for 10 million years (not enough time to get life out of that). If it were stronger by another factor of 10 then the lifetime of a star would be 10,000 years.
3) Stars burn through nuclear reactions that fuse protons and neutrons into a succession of more massive nuclei. For this to happen the masses of the elementary particles must be chosen very delicately. Were the electron’s mass not about the same size as the amount that the neutron outweighs the proton (which is about 0.2 %), and were each of these not much smaller than the proton’s mass, stable nuclei could not be formed (according to the standard model of physics, the masses of these three particles are set by completely independent parameters). The strengths of the different forces must also be carefully tuned to obtain stable nuclei. Stars cannot burn if nuclei are not stable.
4) The neutrino mass must be very small for the nuclear reactions that energize the stars to happen.
5) Why is the universe big enough for stars? Why does it live for the billions of years needed for stars to form? This depends on the cosmological constant which can be no larger than about 1E-40. If it were not, the universe would not live long enough to produce stars. (The value of the cosmological constant given here appears somewhat different from other sources cited below, but it is just based on other units.)
6) If it were not for the strong nuclear force, nuclei would be blown apart. Remarkably, the attractive nuclear force actually balances the electrical repulsion of the protons. If there were not this fine balance there would be no stability and no nuclei. Our existence depends on it. The strong nuclear force must also be short-ranged, otherwise there would be the danger that all the protons and neutrons in the world would be pulled together into one big nucleus.
7) The weak nuclear interaction must be set up in order to govern the basic nuclear reactions on which the physics of stars is based.
Smolin concludes that the chances that a universe created by randomly choosing the parameters contains stars that are suitable to sustain life are ridiculously small. He calculates it to be infinitesimally smaller than one against the sum of all neutrons and protons in all the stars of the observable universe combined, which is 1E80. The number he comes up with, one chance in 1E229 *), comes from a straightforward calculation, explained in the notes to the chapter of his book. A common objection against this sort of calculations is that it is fallacious to vary only one parameter while holding all the rest constant, and probability space would be considerably widened were several parameters allowed to co-vary. Yet as cosmologist Luke Barnes shows in his in his article from p. 19 onward, with impressive graphs for a number of cases, this objection does not generally hold.
*) that is one chance in 10 trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion trillion. No, this is not a joke. (You can do the math yourself: a trillion is 1E12, a trillion trillion (or a trillion times trillion) is 1E24, and so on.)