In the strict world of British military protocol, there are even rules on how to faint with dignity. There are two main reasons why the guards of honor pass out: it can get pretty hot and they’ll lock their knees.
Usually, it’s the combination of both that gets you. And in fact “don’t lock the knees!” is the advice given to troops standing in formation for long periods in the heat.
By locking your knees, you are resting all your weight on the bones and your muscles don’t get to work. The blood flowing to your legs has the benefit of the heart pumping it there.
Once blood is there, it needs the action of leg muscles to help pump it back to the heart. Locking your knees makes standing upright and still easier, but decreases the use of your leg muscles in standing. This causes the blood to pool in your legs, effectively taking it out of circulation.
If your body is moving, contraction in muscles happens and that pushes your blood in veins towards the heart. If the knees are locked and there is no movement, there are no contractions and thus the amount of blood reaching the heart decreases, which also decreases the blood supply to the brain.
When the brain senses a dangerous drop in oxygen, you pass out. An intuitive way of conceptualizing it: blood flow isn’t fighting gravity when everything is on the same level. By passing out, your brain gets itself, the legs, and the heart all on the same plane so no more relying on leg muscles to overcome gravity.
On parade, the guard of honor has to keep his knees very slightly bent, and he has to rock back and forth on his toes and heels, with his feet being opposites at all times. The knees bent and shifting on his feet keeps his blood circulating.
Basically, the guard of honor must stand on his left foot’s toes while he’s on his right foot’s heel, and gently reverse the situation. He just has to do it subtly, gradually, and very gently so it doesn’t get noticed (though there’s usually enough room in parade boots to get away with it easily enough).
If a guard of honor loses his consciousness while his knees are locked his body falls like an upright board that is tipped over.
His head will be moving at a pretty good clip when it hits the ground and he can actually be injured fairly badly. Falling face-first often ends up with the horrible sound of teeth breaking.
This photo was taken during Trooping the Colour, an annual parade of the entire Household Division. Part of that parade is an inspection, which involves the Queen riding around the troops. The picture is taken in the second part of that, where she’s inspecting them from the back.