Why don't birds get electrocuted sitting on power lines?
The necessary conditions for a Electric current to flow are:
Completeness of circuit - Flow of electricity can be considered as a process in which the electrons are drawn from the earth by a power plant. These electrons move through the power lines to our equipment and travel all the way back into the earth. This circuit needs to be complete in order for current to flow.
A potential difference - Another factor deciding the direction of flow of current is (electric) potential. Current always flows from a higher potential to a lower potential. In other words it can be said that electrons flow from lower potential to higher one. (the direction of electric current is opposite to that of the electrons). So we need the potential difference for current to flow.
Path of least Resistance- Factor that decides the path a current will flow in case of parallel paths is the (electric) resistance offered by the path. Current will always flow in the path that offers least resistance.
Now considering a bird is sitting on a live wire and not touching any other wire:
First the circuit is incomplete as the bird is not in contact with any other wire.
It has no potential difference as both the legs of bird are touching the same wire at same constant potential.
The resistance offered by the bird is also too much compared to that offered by the copper/aluminum wire which are known good conductors of electricity hence almost negligible amount of current flows through the bird that does not harm the bird.
Actually, when birds are standing on a single phase power line with both feet, they do get electric shock in the nano volt range so they don't feel anything. Even though they do not complete a path to ground, they are in fact in parallel circuit with the power line.
Since the power line has not 0 ohm of resistance, even between the bird's legs, some electric current is deviated into the bird. That is Ohm's law. Electricity will always follow all the given paths, but how much current flows through those paths depends of their resistance.
If the bird would touch the ground while sitting on the wire or flap its wings and touch another electric wire with a different voltage, then it would get shocked and likely die by electrocution. This is because its body would become a path for the electricity to reach either the ground (no voltage) or a place with a different voltage (another wire at a different voltage, for example).