When connecting adapter power to a battery powered circuit, high reverse current through the battery must be prevented to avoid battery damage.
This can be done with a diode, but that means at least a few hundred mV drop when the battery is powering the circuit, even with a Schottky diode, which wastes power and reduces battery life.
Here's a circuit that uses a MOSFET and comparator to perform that function, so that the forward drop is just the MOSFET on-resistance times the circuit current.
This drop can be very low, since MOSFETs with a few tens of milliohm on-resistance (or less) are inexpensive and readily available.
The LTspice simulation of the circuit is shown below.
The MOSFET is in the negative leg so a cheaper N-MOSFET and a common LM 339/393 comparator that can work on ground based voltages can be used (that comparator input can't work at the high side voltage).
The comparator monitors the voltage at the MOSFET drain and when the drain voltage is negative, indicating normal current direction through the battery, the comparator output is positive, turning on the MOSFET.
If that voltage goes positive, indicating the current is reversing through the battery, the comparator output goes low, shutting off the MOSFET to prevent reverse current flow.
Note that the normal current direction for this circuit is through the N-MOSFET from source to drain.
This works because MOSFETs conduct equally well in either direction when ON.
For 3.6V operation, the MOSFET must be a logic level type where the Rds(on) is rated at a Vgs of 4V or less.
The simulation shows the MOSFET gate voltage [V(g)] from the comparator output, and the V_bat current [I(V_bat)] both going low when Vadapt (plus the diode drop)exceeds V_bat.
Notice that V(out) is 3.594V when running from the battery, only 7mV below the battery voltage. This small drop is, of course, due to the load current through the MOSFET on-resistance.
For minimum battery drain the LM393 should be used since it has a maximum supply current of 1mA as compared to 2mA for the LM339.
Resistor R_Chg is optional, to provide battery charging current when the adapter is connected.
This could be a more complex charge control circuit if desired.
Reverse Current Battery Protection With MOSFET Ideal Diode
Low voltage-drop, reverse current protection for battery when connecting adapter power