Power Switching using MOSFET and opamp
Do you know that the power is shared between both? The point of this arrangement is to prevent just that. IC5B is used as a comparator, when Vin is above 6.6V (since it's divided by 2 and compared against the 3.3V supply) the comparator goes high, switching T2 off and isolating the supply from the USB. If there's no supply at Vin, there's no output from the regulators (top left on https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf ) and T2 is on and draws from the USB. This does leave the regulators reverse biased, presumably they tolerate this.