Somebody most likely taught it. I know that a lot of people I ride with have, and I have to a gelding I used to ride as well. On our long trail rides, every time he would pee, I would whistle as he did it. Eventually, you could whistle and he would pee. It's done mostly with endurance/competitive trail so that the horse will continue to hydrate, pee, hydrate, pee. =)
A horse is the projection of peoples' views about themselves--strong, powerful, beautiful--and it has the capability of giving us escape from our mundane existance.