Start with the first case where Va is more positive than Vb and the MOSFET is turned off. The Q1, source-drain diode starts to conduct. This puts a negative voltage on the U1 inverting input relative to the non-inverting input which is at the same voltage as Va. The output of U1 then goes as far positive as possible (let us say about +13 volts) in relation to Va. This puts a large, positive gate-to-source voltage on the MOSFET which turns it on. The trick is the MOSFET is now operating in the "Triode" mode where the channel acts like a resistor. Current can flow in either direction. The MOSFET channel now takes over the conduction and current no longer flows through the source-drain diode. The "rectifier" is now conducting.
The next case is where Va goes more negative than Vb. The Q1, source-drain diode does not conduct and the U1 inverting input will be positive in relative to the non-inverting input. The U1 output is near the voltage at Va and the gate-to-source voltage is below the threshold of Q1. The "rectifier" is now off.
Here are a couple of concerns. First, the drain-source breakdown voltage of the MTH40N05 is 50 volts. Do not expect this circuit to handle line voltages of 120VAC or higher. Select a MOSFET appropriate for the AC voltage to be rectified. Second, the LM393 common mode voltage range is the negative supply. This circuit requires the inverting input to go a little below the negative supply voltage. This is probably OK but the input is operating out of the specified input range by a small amount. Third, it is not predictable what the voltage on the U1 inverting input will be when Q1 turns off. Is it positive enough to keep the U1 output at the negative power rail? Some leakage will probably do the trick.
Some additions - Leakage of Q1 when off may be enough to get the U1 output to go high and turn on Q1. It may not be necessary for the source-drain diode to conduct. Also, it would be good to add some input protection on the U1 inverting input. When Q1 is conducting, it may be possible to exceed the negative input range of the device. A series resistor and clamp diode may be a good addition.