So how exactly does this common device work?
The word "modem" stands for "modulator-demodulator".
A modem's purpose is to convert digital information to analog signals (modulation), and to convert analog signals back into useful digital information (demodulation).