For fusion to "work", the energy being lost to the environment, mostly through radiation, has to be slower than the rate of new energy being created by the fusion reactions. As long as that is true, the fuel will continue to stay hot.
An added annoyance is that some of that energy being created is in a form that cannot easily be captured within the fuel, like neutrons. In the D-T reaction, the neutrons are 75% of the energy, which makes things difficult.
So, what is the rate of fusion? There are three important bits:
the temperature - the fuel consists of ions which naturally repel each other, so the energy of the ions has to be at least this "Coulomb barrier" value. It also can't be so high that the ions just go whizzing past each other without a chance to react. The result is a curve of energy vs. probability, or more commonly, temperature, which looks roughly like a bell curve with a peak reaction rate at some characteristic value. The latter is not the same as the former, because in a fluid the particles will be at a mix of temperatures, so even in a fuel that is in bulk below the Coulomb barrier, some of the ions will have enough to fuse. In other words, even if your prob/energy curve peaks at the energy equivalent of 1 billion degrees, the fuel as a whole only needs to be 50 million, which will give you enough high energy bits in the long tail to keep things going.
time - if you have a mix of fuel and only some of the ions have enough energy, they are going to take some time before they randomly bump into someone going the other direction with enough energy. The fuel has to stay in that state long enough that these reactions occur, and this bit is important, if that energy radiates away before the reactions occur you're sunk. So the real measure here is what they call the "confinement time", the time that the energy stays in the system, not the time any given particle does. In the past, the systems were so leaky that the particle confinement time was less than the energy time, so this was academic, but these days we have a bunch of concepts that can keep the plasma in there on the order of minutes and now the energy loss dominates.
density - if you pack the fuel together tighter, the ions don't have to go as far before they meet their partner. So (2) and (3) work in concert, if you increase the density you'll increase the rate of fusion events, so you can back off on the confinement time because it won't cool as much in that shorter period.
The product of these three numbers gives you the rate of fusion, and this is so important it is known as "the fusion triple product".
So back to your question.
The reason you can get fusion in a tokamak at very low densities/pressures is because they ramp up the temperature. The sun's core is around 15 million K, whereas devices like ITER aim for around 100 million or more. This puts it right on the peak of the D-T reaction curve. Then they use huge magnets to hold the plasma like that for long times. Now it's the energy confinement time that's important, not the plasma's lifetime, and to help with that they have all sorts of systems inside the reactor to remove any other atoms that bleed off energy. In contrast, the sun is filled with "ash" and all sorts of other crap that are releasing lots of x-rays and the energy is flowing out continually - that's why we can see it in the sky. So basically, tokamaks (etc) have much better (1), somewhat better (2), and thus back way off on (3).
There is another sweet spot. Density has one other advantage... although most of the energy released in D-T is in the form of neutrons, about 25% is alpha particles. Those are charged, so in ITER the magnets catch them and they thermalize in the plasma. This is called "self-heating" and is vitally important.
Thermalization is due to the alphas interacting with the other ions electromagnetically. If you increase the density, those reactions take place much faster. In ITER, that process takes a couple of meters (or more, my memory fades) but if you increase that density enough, it can happen in fractions of a millimetre. "Enough" turns out to be about 30 to 50 times the density of lead.
This is how a hydrogen bomb works. The "secondary" is collapsed down on a thin rod of plutonium which gives off a huge burst of neutrons. Those travel outward into LiD fuel surrounding this "spark plug", where they cause a reaction that releases T. Now you have D-T at immense pressure (like 1000x lead or more) and so the alphas instantly heat the fuel around it so that fuses too, while the neutrons are making more T. The explosion travels from the spark plug core outward, burning the fuel as it goes. It's amazing that it works at all - if any of the reaction times were a little different it wouldn't.
So the other major approach to fusion is the "inertial" approach. Here you rely on the fact that even as it's exploding, the expansion of the fuel is still slower than the fusion reaction. That's only true if your density is high enough so that the alphas thermalize really fast. So at NIF, they use lasers to crush a capsule with a tiny amount of fuel inside, and even though the reactions are blowing the resulting dust-sized fuel blob apart, (2) is still enough that (1) and (3) get you into the same ballpark.