They filter out certain frequency ranges before the signal reaches the speaker. A high pass filter will let high freqs past but block low freqs, and a low pass filter will do the opposite.
You want a LPF for a subwoofer (set at roughly 80Hz), a HPF for tweeters (say 4khz and above) and ideally a high pass filter for the mids too, set at around 80Hz.