What does this MOSFET do in this voltage regulation circuit?
It's a P-channel MOSFET. But it's in backwards, so it's basically acting as a diode due to the body diode. That's ok, as I will explain below.
Assume that the battery is one LiPo cell (3.7 ~ 4.1V max.) With the V_USB off, then the FET body diode is forward biased. The FET is also turned on (fun fact: current can flow in either direction in a FET.)
Now turn on V_USB. D2 conducts and current flows. The FET body diode is no longer forward biased, so no current flows. The FET is also turned off.
Go ahead, try it here

Now, see what happens when the FET is flipped (try it!)

When the USB_5V is on, the FET body diode conducts... into the battery. Eventually overcharging it and possibly blowing it up! Oops.