Birds can sit on power lines and not get electric shocks because the electricity is always looking for a way to get to the ground.
The birds are not touching the ground or anything in contact with the ground, so the electricity will stay in the power line. But if a bird with large wings touches a power line and a tree or power pole at the same time, it gives electricity a path to the ground, and could be shocked.
And if a bird touches two wires at once, it will create a circuit — electricity will flow through the bird and likely electrocute it.
Southern California Edison's Avian Protection Program makes power lines safer for birds by providing greater spacing of wires or protective covers on distribution poles to prevent birds with wide wingspans from accidental electrocution.