What does that thing do? It's a lightning arrester.
Lightning arresters divert lightning away from the electrical power supply and to the ground.
Lightning can hold up to 300,000 volts of electricity, but your home can accept a maximum of only 240 volts — more than 1,000 times less. Without lightning arresters, your home, and the power supply itself, would be far less safe.
Now you know what that thing does!