Why doesn't the nuclear fusion in a star make it explode? I have a rather naive question. In stars such as the Sun, what prevents the whole thing exploding at once? Why is the nuclear fusion happening slowly? I can only assume that something about the fusion is fighting the gravity and slowing the fusion down and when that process is done gravity starts the fusion process again. 
 A: The fusion that occurs in the core of the Sun occurs in nothing like the conditions you might be thinking of in a bomb, or a fusion reactor. In particular, it occurs at much lower temperatures and at a much lower rate. A cubic metre of material in the solar core is only releasing around 250 W of power by fusion.
The fusion rate is set by the temperature (and to a lesser extent, density) of the core. This in turn is set by the need for a pressure gradient to balance the weight of material pressing down on it from above. The core pressure is set by the need to balance the weight above it; the core pressure is determined by the temperature and density of the core; and the temperature and density of the core set the fusion reaction rate.
At 15 million kelvin (the Sun's core temperature, which is much lower than the temperatures in nuclear bombs or fusion reactors), the average proton has a lifetime of several billion years before being converted (with three others) into a helium nucleus. There are two reasons this is slow. First, you have to get protons, which repel each other electromagnetically, close enough together to feel the strong nuclear force. This is why high temperatures are needed. Second, because the diproton is unstable, one of the protons needs to change into a neutron via a weak force interaction, whilst it is in the unstable diproton state, to form a deuterium nucleus. This is just inherently unlikely and means the overall reaction chain to helium is very slow.
The reason there is no bomb-like explosion is because there is no problem in shifting 250 W per cubic metre away from the core, in the same way that a compost heap, which generates about the same power density, does not spontaneously explode. In the case of a star any additional heat goes into more radiation that diffuses away and in work done in expanding the star. As a result, the temperature of the core is stable - the timescale for the structure of the star to change and maintain stability (millions of years) is much shorter than the timescale on which the nuclear fuel is burned (billions of years).  Ultimately, any additional energy emerges as sunlight at the solar photosphere.
If for some reason, the opacity to radiation in the core increased, then the temperature would rise and more energy would be generated by fusion. This is exactly what happens in the core as more hydrogen is turned into helium; the core temperature and luminosity do rise, but slowly, on timescales of billions of years. There isn't a runaway explosion because the star can easily adjust its size and luminosity to radiate away the rising fusion rate.
A: Fusion in stars requires enormous pressures and temperatures.
Any body, including stars, are subject to their own gravitational field.  At any point inside a spherically symmetrical body (which most stars approximate well) the gravitational force will be due to all the mass "below" that point - between that point and the center.  That gravitational force obviously points inward.
However all the mass outside that radius is also being pulled inward and exerts pressure on the material below it.  This adds to the gravitational force of the material inside.
So enormous pressures exist at the core.  As the pressure increases the conditions for fusion become more and more likely.  When fusion happens the core region that can allow fusion is kept contained by the pressure from the material outside that core, which cannot fuse.  Note that fusion doesn't happen everywhere in the star, just at that core region which has reached high enough pressures.
The energy being generated by fusion keeps everything hot (simplistically) and hot things like to expand and produce an outward pressure.  It's the outward pressure from fusing core's thermal energy (which is passed by radiation and convection throughout the star and eventually outside the star as light) that prevents the gravitational collapse of the core due to the force of everything pressing "down" on it.
So it's the gravitational force the body exerts on itself that prevents it "exploding" because it causes fusion which generates heat that pushes against the collapse.

Why is the nuclear fusion happening slowly? 

Slow is a relative term, but the rate of fusion is decided by the pressure and temperature inside the star.  Oddly enough smaller stars tend to live the longest.  This, very simplistically, is because the pressures at the core are relatively low and the amount of fusion that can be maintained by it and the size of the fusing core are correspondingly small.  Larger stars have more pressure and larger cores and can burn relatively quickly.  The detailed reasons behind the lifetime of stars are somewhat more complex.  If you want to read more about this I'd suggest reading e.g. Wikipedia's pages on red dwarf stars and Stellar Nucleosynthesis.
A: Stars live most of their lives (see main sequence) in a dynamic equilibrium. If the core gets extra hot because of increased heat production, the star expands and the rate of the fusion decreases.
In most cases, the equilibrium is also pretty stable and the star does not oscilate its heat production. Well, some stars DO oscilate their luminosity, but that happen mostly outside of the core (see ex. cepheide).
The equilibrium is sometimes lost (see ex. supernova) and we see a real nuclear explosion "at once". Well, for such a large object nothing happens "at once", the process takes minutes or hours, but it is still pretty fast compared to the lifespan of the star.
p.s. in fact, stars start shining even before they start the nuclear reactor in their cores. The first light comes from the gravitational collapse of the initial gas cloud. The extra heat from the nuclear reactions just stops the collapse for a while (few million or billion years).
A: An explosion always requires a self-accelerating process. If you set a pile of conventional fuel on fire, it will not explode: it will quickly consume all the oxygen in the surrounding air and the process will slow down waiting for more oxygen to be available. If you want to make an explosive, you will need an oxidizer: a substance which releases oxygen typically in response to temperature. That way, the heat from the fire will release more oxygen which will create more fire etc.
A thermonuclear reaction is accelerated by density. In a hydrogen bomb, the self-acceleration is achieved by starting the reaction around a mass of hydrogen, so that the shock wave from already consumed hydrogen compresses the rest of the load, which itself starts to fuse, creating even more pressure.
In a star, the thermonuclear reaction happens in the core, so the heat it creates pushes the rest of the matter apart, reducing the density and slowing the reaction down. The system then achieves equilibrium in which any change in density is neutralized by the system itself.
A: If fusion were to proceed faster, the core would get hotter, it would expand and become less dense, and with less density, fusion would slow down. 
The main sequence in stars like the Sun does proceed much more slowly than other stages. This is because the p-p chain reaction starts with the fusion of two protons to form a diproton, or helium-2. The diproton is unstable, and usually immediately decays back into
two protons, but Bethe realised that on rare occasions it decays by a weak reaction,
releasing a neutrino and a positron to form a deuterium nucleus, hydrogen-
2. Because this second process is so rare, it limits the rate of stellar fusion so that
stars spend the largest portion of their lives on the main sequence
A: You are asking why the fusion is a slow process. 
To understand this it is very important to see that the fusion itself means that two protons in the core, separated by the Coulomb forces, must overcome this repulsion. And one of the protons needs to inverse beta decay into a neutron (deuterium nucleus).
https://astronomy.stackexchange.com/questions/30035/why-doesnt-the-fusion-process-of-the-sun-speed-up
It is all QM, and probabilities, and the probability is 1 in 3×10^29 collisions.

Two protons within the Sun fuse. Most of the time the pair breaks apart again, but sometimes one of the protons transforms into a neutron via the weak nuclear force. Along with the transformation into a neutron, a positron and neutrino are formed. This resulting proton-neutron pair that forms sometimes is known as deuterium.

https://energyeducation.ca/encyclopedia/Nuclear_fusion_in_the_Sun
A: Gravity compression of a lot of "stuff" in something as big as the Sun is stronger than the push from the fusion happening in it. Although it does "explode" when its gravity isn't strong enough to keep the core from pushing the outer layers out by the time fusion makes the element iron (for most stars this happens) leading to the outer layers being lost like your skin and leaving behind a meaty heavy core OR it it might "crunch" if gravity beats pressure (the result can be either a neutron star, lighter original star, or a blackhole, heavier original star.  
A: I'd like to add a "baby" answer, to highlight an important point that may be a bit hidden in the other, better, answers.
Feedback and self-organization: The reactions in a star are not "slow" and not "fast", they are just "right" (actually, from another point of view, the one in this answer, they can even be considered "fast", as they keep the system in quasi-equilibrium!). The right amount to counterbalance gravity (that's why more massive stars live less, they must burn faster).  The reaction rate is the one adjusted to keep the body in quasi-equilibrium. The system self-organizes itself to find a "sweet spot" because of a feedback mechanism:

*

*Gravity always pushes (it's the "driving" force).


*Pushing increases the rate of reactions (positive feedback in reactions can increase the rate, and in some cases can lead to explosions, see below).


*This generates heat, but does not necessarily increase the temperature! This is the "negative part" of the feedback, namely stars can have "negative heat capacity".


*Heat creates pressure to counteract gravity (so also the "driving force" is adjusted: the system is self-gravitating).
You have too few reactions, you contract, heat up the matter and increase the reaction rate, till you find a new equilibrium. On the other hand, too much pressure makes the gas expand, cooling down and decreasing the reaction rate (it's a bit more complex than this because the system is also radiating energy, and this adjusts the negative part of the feedback, see this question).
You leave the quasi-static part of stellar evolution when this feedback cycle fails somewhere: rather than saying that reactions in a star are "slow", I would rather say that the ones in a bomb are "fast". In fact, it's a "nuclear bomb" to go strongly out of equilibrium: that needs a chemically metastable state, activation energy - like in stars - and strongly positive feedback that is not counterbalanced on the timescales of interest - unlike what happens in stars.
NOTE: This is a baby tale, stellar evolution is much more complex than this. But you get the "gist."
A: There is something that "slows the fusion down" actually: radiation pressure. The idea is, nuclear fusion creates nucleons, energy, etc, and also light. Light exerts pressure, it's just very small in everyday life. For very massive stars however, then the radiation pressure becomes important, and it's the reason why gravity doesn't cause the star to collapse.
Radiation pressure sets an upper limit for the mass of a star, because if the star got much bigger it would blow itself apart similar to the explosion you're thinking of. This limit is known as the Eddington limit.
Nonetheless for most stars, radiation pressure is not nearly enough to blow the star apart, and stars don't explode.
