Think of the wires as pressurized with excess electrons from the energizer's pulse.
Green vegetation is a conductor—particularly when wet. When it contacts and energized wire, energy is pushed through the moisture in the stem into the soil. This is often called a "leak" (similar to a hole in a water hose) or a "short."
In short—grass leaks electrons from the fence. However, if the energizer's pulse (joules output) is large enough, it can cope with the loss due to grass contact (overcoming weed-load).
What happens when an animal touches the energized wires?
The high voltage of the pulse pushes electrons through the animal's point of contact (often nose or ears) then through the body's tissue and fluids and out through the feet/hooves/paws into the soil moisture.
Is the animal's weight a factor?
The weight of a heavy animal compresses the soil. This reduces electrical resistance of the soil and increases the joules that can flow through the animal.
This explains why heavy animals are more affected by electric fence and light animals less so.
Weight (or the lack of it) explains in part why calves and lambs will seem to be less affected by a pulse than adult cows and ewes.
Which species are most affected by an electric fence pulse?
In order from most to least: pigs, horses, cattle, canines (wet noses, bare pads) raccoons, sheep, goats, deer, geese, chickens and rabbits.
This assumes a low-impedance energizer was used and adult animals are contacting the fence with their nose, beak or paw.