An ethernet loopback is used to... perform loopback tests - obviously...
Lets cut to the chase - you can create two types of loopbacks, most only require the basic type.
RJ-45 Pinouts for Ethernet:
away from us.
Basic loopback (shown below - image from Juniper):
Full loopback (often needed for gigaports - image from I-Hacked)
When to use ? A crossover cable is used (generally) when connecting the same device type to one another, e.g. switch to switch/switch-hub/hub-hub (unless using the uplink port) / computer-computer / router lan-switch or hub, etc...
Many modern switch's, hub's and router's support automatic MDI/MDI-X (Medium Dependent Interface / Medium Dependent Interface crossed), In general computers and routers use MDI and Switchs and Hubs use MDIX.
Quick tip: When creating crossover/loopback you always cross the cables as follows:
Side A Side B
Leaving the other cables to run without crossing them; an easy way to remember how to cross is 1,2,3,6 goes to 3,6,1,2 (one, two, three, six -> three, six, one, two)