What is the exact principle of this circuit? (PNP transistors and P-channel MOSFET)
I know I did an analysis of this circuit not very long ago, but I can't seem to locate it now.

The basic idea is that the two BJTs form a differential amplifier, comparing the voltages at either end of the MOSFET (drain and source). If the drain is even a tiny bit more positive than the source, then Q3 is cut off and the MOSFET is switched on. Otherwise, Q3 shorts the gate to the source and cuts off the MOSFET.

This is one way to produce an "ideal diode" &mdash; i.e., one with essentially negligible forward voltage drop.