What is an electric shock? It’s a a sudden discharge of electricity through a part of the body.
For a sudden discharge of electricity, the prime need is a potential difference. When the bird perches on an electric line, it is at a high potential, but it is not subjected to a high potential difference between two parts of its body and hence it does not get a shock. The entire body is raised to the same potential as that of the electric line.
So, the electric potential difference is the VILLAIN.