

Certain employer-sponsored visas have requirements that the job be posted for a period of time to see if any US applicants apply. This is supposed to make sure the foreign worker isn’t “taking a job away” from a similarly qualified American.
Companies do prefer to hire foreign nationals for these jobs, though, because they typically take less pay, and their US work authorization is tied to their employment, so that makes it much harder for them to change jobs in the US without leaving the country first. So while they are supposed to “post the job” for Americans to apply, they will do the bare minimum to post it, and make sure the requirements are written so that no one other than a foreign worker would bother applying.

AI won’t replace mathematicians. But AI may replace their grad students, when the Computer Science department shows how much more “work” the Al can do and steals funding from the Mathematics department.
Then, when the current Math faculty retires, there won’t be any new Mathematicians to take their place.