On non-beginner parts of the hill, I do it to partly make a point, and partly to give the other skier a chance to recognize the fact that someone is behind for safety reasons. It's not always just about ME, and it's not always just about PASSING, per se; sometimes clueless people just need a wake-up call that other people are on the hill nearby, also moving. When someone is skiing erratically and/or just obliviously in a way that makes it hard for other people to get by in a place where they might legitimately expect to be able to get by, I give the old "on your RIGHT!" shout but hold back a second to see what happens. If the other skier then appears to realize that other people are behind him and are waiting to get by, he'll usually move over or otherwise shape up. Sometimes it's a skill / control problem. In those cases, too, I think it sometimes helps, because the person will REALIZE that their lack of control is causing a problem for others and he'll pull over to regroup for a minute. If he doesn't, well, he doesn't. First world problem. Have to wait. I ski pretty often at areas that have very narrow runs by western standards, so this topic can arise with some frequency. Sometimes I'll mouth the words of the same shout in an exaggerated way, sotto voce - "HONN YHOUR LHEFT" - to a group of six skiers standing around taking up nearly the whole trail, as I wedge carefully at 0.5 mph six inches from them, through the little chute they've thoughtfully left between themselves and the fir boughs. Some trails are narrow enough - I'm thinking of Muleskinner at Saddleback, for example - that even one person standing in the wrong spot can make a "heads-up" a good idea. On green runs I don't do this except in really egregious cases, since I figure I'm the visitor there and need to be the one to respect the primary activity of the locale - staying vertical for as long as possible.
It's exactly the same thing you see everywhere else in life. In the hallway at work, for example. Hallway wide enough for three people, you've got three people sauntering at a snail's pace, totally absorbed in their whispery office gossip, without a clue in the world that others are actually trying to use the hallway to get from point A to point B.