It uses one charge pump to double the supply voltage, and the second charge pump to invert it. The idea behind the charge pump doubler is that capacitors are first charged in parallel, then they are switched such that they are connected in series.
(Source of picture: datasheet for ICL232, which is similar to MAX232.)
As an aside, I've seen hacks where +10V and -10V generated by the MAX232 were also used as supply rails for OpAmps. It's not the best power supply, and it's got switching noise from the charge pump. But it may still work, if the analog section is not very sensitive, and it needs a negative supply rail, and there is no other option for generating the negative supply rail.
Assume we start with \$t=0\$ and a positive-going sine wave for the voltage source. Also assume that \$V_C=0\:\textrm{V}\$ at \$t=0\$.
As the voltage rises, the diode blocks and doesn't conduct. So the voltage is applied across the resistor and capacitor and current flows only through that branch. This will slightly charge up the capacitor from the resistor's current for the small time of this first half-cycle. But negatively, such that there is a slightly negative voltage on the right side relative to the left side.
Then, as the voltage swings around and heads negative relative to ground, it pulls the left side of the capacitor down with it. Now, the diode conducts (ground is now positive relative to the tiny negative voltage on the capacitor added to the peak negative voltage on the supply) and charges the capacitor in the opposite direction to before, but far more quickly because there is a diode in parallel with the resistor. The resistor probably doesn't contribute much of the current pulse during this second half-cycle. And the diode will pass a lot of current to charge up the capacitor rapidly. Possibly up to a diode drop lower than the peak voltage.
Now, as the voltage supply swings back positive, it pulls the left side of the capacitor back upwards with it. But just moments earlier the capacitor has been nearly fully charged positively (the right side is positive relative to the left side) because of the huge current pulse that just went through the diode. So that voltage now adds to the positive voltage present on this upward swinging positive half cycle of the voltage source. So the voltage can reach almost twice the input voltage, less a diode drop.
There will be a tiny bit of current dragging this back down, too, through the resistor being exposed to this near-2X voltage. But it won't change things much.
That's pretty much how it happens.
Best Answer
It doesn't actually change the peak-to-peak voltage of the AC waveform. What it does do is impose a DC offset onto that AC waveform.
So, a wave that is say +/- 12V becomes a 0-24V waveform (less a little bit for the diode voltage drop).
The capacitor is charged up when the waveform goes negative (through the diode), and releases its charge when the waveform goes positive.
Here is a link to the Falstad Circuit Simulator with a Villard circuit. You can see how the waveform stays the same but is shifted upwards.