Why is a resistor divider used on gate of P-channel MOSFET of discrete USB power path circuit?
I understand the job of D1, Q1 and R2. When USB is disconnected, R2 pulls the gate of Q1 to 0V and Q1 switches on so that VBAT.


Actually it's not the case. VBat always supplies the VCC5V due to the protection diode in Q1, the only difference is that when it's pulled down, it will have less loss as the mos will switch.

Supposedly it is supposed to work like this:
As the battery is 3.7V, when you connect the USB, R2 (0ohm) will pull the gate up to 5V, and thus disconnecting the battery from the circuit if the gate threshold is below 1.3V, drawing current from the USB instead of the battery.

But this implementation is quite strange and if VUSB increase for some reason, or the battery voltage decrease, you might overload the battery, and have a nice fire. Also the gate threshold voltage vary a lot with temperature.