It's not limited to visa-cheating; in certain industries, you have to advertise the position even if you already know who you're going to hire. Look at the backpages of publications like The Economist - do you really think huge companies will find a CEO or Senior Executive with a magazine ad? Of course not.
That's how I got my current job. I was working as a consultant for a company, and we all mutually decided that I should come in and fill a rather high ranking permanent role there. They asked me to write the job description for it, and work with HR to get it posted. That night I went home and applied for the job. That being said, I've never properly applied for a job in my life, and I'm pretty sure this is rather common.