The paths an electrical current takes to reach animals can be varied and complex. Most of the problems stem from improper installation of electrical systems and milking systems.
Improper maintenance can also be an issue.
Of course, problems can also originate from off-farm sources like utility system ground wires, high resistance utility neutral wires, and faulty transformers. In fact, it's not uncommon for utility lines to serve as pathways that simply allow a neighbor's electrical problem show up on your farm.