The electricity does not harm the animals. It only keeps them from escaping onto roads and being killed by traffic. You could be shocked. An electric fence can be identified by strands of metal wire which stretch from post to post. Typically, white, yellow or black knobs are attached to the post.
Cows are also very protective of their young.
This would likely upset the mother. Cows are very large animals and can be unpredictable. If you come across a cow that has wandered outside their fence, don t try to return the animal to its pasture. Contact the farmer so he can retrieve the animal. As dairy farms modernize, cows are often kept in the barn all the time.