Even though they are connected to the same computer, their ground is not connected to exactly the same point of the computer, and since there is a non-zero resistance between the two ground points, a non-zero voltage can fall on that from the ground currents of the CPU, GPU, and other devices. Balanced interconnects, when implemented properly, do eliminate ground loops by not using ground as the reference for audio signals - ground noise (relative to pin 1) appears as common mode noise on both pin 2 and pin 3, and it gets rejected by the differential input.
To demonstrate this in practice, here are three RMAA measurements of the same sound card output, using three different configurations for recording:
The first case is a simple loopback, using the ADC is on the same card. There is no ground loop problem, and the results are quite decent.
In the second case, I used the Xonar Essence STX sound card installed in the same PC for the recording. Even though it has a better ADC than the Xonar D1, all the measurements are notably worse, and the noise in particular is dramatically worse, and is degraded to the level of typical onboard audio. The reason why this happens is that there is a ground loop between the two sound cards, even though their audio jacks are separated by the ground resistance of only about 5 centimeters of metal chassis.
The third case is similar to the second one, but this time I inserted a
differential amplifier to the loopback to reject the ground noise. This configuration gives the best results - now taking advantage of the better ADC - except for crosstalk, which is slightly degraded by the extra cables, connectors, and amplifier circuit. Using a differential input improved the noise by 22 dB.
You may wonder why an RCA to XLR adapter does not necessarily work as well as the third test above, which essentially does the same. The potential problem is that the adapter may connect the ground wire to both pin 1 and pin 3 of the XLR connector so that there is a ground connection between the two devices, but that also prevents the differential input from being able to reject the ground noise.