Didn't know that but there are invisible fences.
True, but those are not always effective.
For instance: if someone digs somewhere, cutting into the invisible fence, it is rendered ineffective.
If you have a dog with thick fur around the neck (think the northern, spitz breeds, in particular), the ‘shock’ will be diminished, and the dog may decide to “make a run for it” and bolt outside the yard.
Which are totally useless if you have a fast dog or any kind of sight/scent hound.
They will spot ‘prey’ and be across that barrier so fast they’ll never even feel a tingle.
I know tons of Sight Hound/Hound people.
They do not use invisible fence....more than once.
Aside from all that, cops have shot dogs wearing fence collars inside their own yards because they ‘didn’t see a collar’ and assumed the dog was running loose and They Felt Threatened®.
Invisible fences do not always work. I’ve known two dogs (a Boxer and a Pit mix) who, if they wanted out badly enough, would simply charge through and take the hit. Another (a Border Collie, natch) would get close enough to the “fence” to get the collar to continuously beep but not actually deliver a shock. After the battery ran down (and the beeping stopped), she would simply walk through the “fence.”