checking for cracked head or bad head gasket..

see the idea is when you pressure test the cooling system you want to have the plugs out so that when/if the head gasket is blown into the cylinder, the pressure can
escape and therefore show up on the test as a leak/lose of pressure.
otherwise the rings can hold it in.

Exactly. I chased a seep years ago and had trouble finding it. An old timer asked if I removed the spark plugs to do the test and I hadn't. I removed them, redid the test and solved the problem. The result was the compression that was in the cylinder wasn't allowing the seep to show up.

It could also help to tell what side of the engine the leak if any is located.