Believe it or not, there are parts on our devices that seem to have no use at all, but it is interesting to learn their purpose. No matter how weird some part appears, it is always there for a reason.
This is the case with the cylinder on laptop chargers. Probably, you have been using a laptop for years without even noticing this small part. In fact, this cylinder serves to isolate the laptop of electro-magnetic interference and high-frequency noise collected by the cable itself or noise in the AC-DC converter. It is a type of an electro inductor that releases high frequency current and serves as the most powerful device for suppression of high frequency noise.
It may be called with various names. Some of them are: ferrite bead or ferrite choke, ring, core, EMI filter, and block.