Dogs can use whistling as a signal to find their owner, regardless of their location.
The dog was able to use your friend's whistling to find her because the dog was trained to associate the sound of the whistle with your friend's presence and return to her.
Dogs have a keen sense of hearing and can distinguish different sounds.
Through consistent training, the dog learned that when it hears your friend's whistle, it should come back to her, regardless of her location.