It doesn't any more than a sniff test if that's what you're asking. When the headgasket's integrity is compromised it will get worse and start leaking elsewhere with each heat cycle, making it's way into the bore. The best method of ascertaining with absolute certainty whether the headgasket has failed is by removing it. Leak down test, sniff test, compression test and water vapour test are only methods of diagnosis and not full proof.
For the purpose of general motorists a compression test, sniff test or leak down test will suffice. While none of them are 100% they have been used successfully in the industry with great success. A competent mechanic would be able to eliminate probable causes to derive at an ultimate probable cause.