Does this distinction actually exist in how people use the words "expat" and "immigrant"? A lot of the time, immigrants will have accepted their job offers already before entering the country, and if they did not switch countries, they would have the same kind of job in their home country anyway (e.g. immigrant nurses recruited by the NHS).
The dictionary definition (OED) talks about the immigrant being a person who enters a country to live there permanently, but in reality, even those who enter with the intention of leaving after a few years are considered immigrants by everyone around them if they are from a third-world country.
Right, but the point is people who are generally called expats get a job offer in another country, and move because of that job.
People who are generally called immigrants want to move, and so try to get a job in another country (or maybe don't, depends on the relationship between the two countries and the status of the person.)
The expat causality is (typically) "job -> move", the immigrant causality is (typically) "want to move -> job".
The actual ordering of when the move happens and when the job is got aren't that relevant.
Also notable that there are plenty of exceptions, grey areas, regional differences, etc. involved. Which is why I don't like sweeping statements like the one I was originally replying to, because they're invariably wrong in some situation.