The dog learns where the boundary is through the use of the flag and the beeping sound. For those with no flags, when the dog reaches the restricted area, they will first hear the beeping sound before they get shocked. This will alarm them to move away from the area. The next time they step on the particular zone they will know that they should not be there.