It is a hardware diagnostic feature that loops the port’s transmit signal back into its receive path to verify the integrity of the physical interface. It’s primarily used for troubleshooting, but not during "normal" operation...since enabling it take the interface out of service and disrupt trafic.
An external link partner is not require for an internal PHY loopback test, though a loopback plug can be used if you need to validate the entire Tx/Rx path including the port’s connector...