How does the Arduino UNO auto-select USB or DC power?

Thanks lefty and doc. Great explanations as always.