How an electric fence works