It's called a choke.
Ferrite choke, used to block common-mode current. It doesn't stop all interference, only high-frequency common-mode interference. Fortunately in this case, that must have been the type of interference causing the problem.
It works the other way too - if a device is generating interference, a choke in the right place will greatly reduce the strength of that interference. Be nice to your local ham radio operators and just stick chokes everywhere, please.