The message is screen printed in a clear, water-repellent ink. On a dry shirt it is practically invisible, so the tee reads as plain heather grey.
When you sweat, the cotton around the print soaks up moisture and turns darker. The printed letters repel water and stay light, so the line appears against the darker fabric, right where you sweat first: the chest and the collar.
As the shirt dries, the line fades back into the fabric. Rain or a splash of water works the same way as sweat.