These large polls at the top of most buildings are known as lightning rods. Whenever lightning strikes the building they take the electric discharge and conduct it to the ground.
This protects the buildings from unwanted damages/ dangers. Now there needs to be something called down conductors that carry the current all the way down to earth.
There will also need to be a surge protector that protects against sudden spikes and simply diverts any excess current to the ground.
Now I am not exactly sure how tall the building needs to be in order to get a lightning rod.
This likely varies from location to location and on the building codes of the government.
I am pretty sure most people already had some idea about the function of those poles at the top of the building but I thought it would be fun sharing this!