A phaser effect is very much like a flanger but is considered milder and subtler in its output, you can think of it as having a spacey and swirling effect with a consistent motion, rocking back and forth. Phasers are frequency-based whereas flangers, although similar, are time-based.
Phasers are designed to split the signal of your instrument into at least two copies. One copy is left unchanged and will be combined with the other copies as it leaves the effect process.
The other copies of the signal are sent through an all-pass filter, this basically shifts the phase of the signals around a set frequency (it does not shift levels of the frequency). This phase shift in each copied signal causes the frequency to be delayed by different amounts.
The original, unaffected copy of the signal is then connected to these phase shifted copies to give you that spacey, rippling effect that the phaser is famous for. How many copies and how much the signal is shifted is often dependent on the make or model of your phaser.
Phasers and flangers are similar and are both known as synth-based effects. The incoming signals are altered using additional waveforms, which are then combined or swapped with the clean signal to produce the desired effects.
It’s also useful to point out that phasers are noticeably different from gain-style effects, where the incoming signal is altered via the amplitude (distortion and overdrive) rather than the frequency.