At my former employer, I once worked with a foreign national named Vignesh who was very good at what he did and was very pleasant to work with. He did a great job, and everybody liked him - he was just the kind of employee (er, "associate") that every employer would want.
One day, my wife pointed out a job ad from our employer that related to the specific field I was in. When I read it, it seemed to be a very specific description of Vignesh's job. I though, "Oh no! - They're trying to replace Vignesh!"
Later, I found out that they were advertising his job for legal reasons to be able to say that no American could fill it. The gimmick was to describe his job so specifically that virtually nobody but Vignesh had the exact expertise to fill that exact job today. Of course, anyone with related expertise in his field could step into his job and come up to speed in a reasonable time. But no one could be hired who already knew the exact things he knew today.
I was happy for him that he got to keep his job, and I can understand that my (former) employer would want to do whatever they could to keep him. But this story does illustrate how the system can be gamed. I bet other employers do the same thing.