A 'phase' is a position on a frequency spectrum - when you see a waveform, you're seeing numerous phases beginning and ending as they hit the zero degree axis.
The Phase-shift sound is achieved by mixing two identical signals together; one signal is the dry input signal, but the other has multiple peaks and troughs applied to its frequency spectrum - this is called an all-pass filter, meaning any frequency can be cut or boosted. The position of this filter can be gradually moved around using an LFO, and this altered signal is then combined with the original.
Because of the movement caused by the LFO, your guitar goes in and out of phase - the frequency spectrums of the two signals match, then unmatch, then match, and so on...and this, folks, is how you create a swirling Phaser effect!
Phasers often use multiple all-pass filters in a chain - this is why some Phasers have multiple 'stages', creating more complex overtones. In some cases, the output can also be partially fed back into the input, generating feedback that adds another dimension to the sound. Here's a nice diagram that'll do a way better job of explaining: