What is this called?
That’s a ferrite core. It’s just attached around the cable. 

It behaves basically as a high-frequency transformer with a resistive load. Its function is to dissipate high-frequency energy as heat.

The most likely reason it’s there is because your device/computer could not pass electromagnetic emission testing without it. Too much of the internal signals are being conducted via the power cable, which then serves as an antenna. 

It’s a lot cheaper and faster to attach a ferrite core than to find and fix the problematic spots in the PCB.