This is really just a footnote to Rob's answer.
The Sun is an absolutely terrible fusion reactor. It uses a reaction $p + p \rightarrow d$ that is hopelessly inefficientthat is hopelessly inefficient. The $d + t \rightarrow He + n$ reaction that we use in fusion reactors is (up to) 26 orders of magnitude faster26 orders of magnitude faster. As Rob says in his answer, the power produced per cubic metre in the Sun is embarrassingly low. However the Sun has the big advantages that its core (where the fusion occurs) is very, very big and very, very dense. The fusion reactors we've managed to make so far are small and the plasma is little different to a vacuum - the particle number density is about one millionth of the density of air.
All this means that our fusion reactors need all the help they can get if they're going to produce a useful amount of power. Adjusting the temperature to maximise the $d + t$ cross section is one of the ways we can boost the power output. The Sun isn't at the optimum temperature for fusion but, well, it's big enough and dense enough that it doesn't care.