I always thought it was to do with "im" as a prefix meaning "inward" (implant/implicate) and "ex" as a prefix meaning "outward" (excavate/exclude/exit). So a person who comes to your country is an immigrant and a person who goes from your country to somewhere else is an expat.
But maybe I'm just reinterpreting a bit of passive racism in a nicer way
Literally (etymologically?) yes, of course.
But we also use "expat" to refer to people who might not be from our country, not left /here/ but left Australia, the USA, other European countries, to go somewhere else.
I always thought it was to do with "im" as a prefix meaning "inward" (implant/implicate) and "ex" as a prefix meaning "outward" (excavate/exclude/exit). So a person who comes to your country is an immigrant and a person who goes from your country to somewhere else is an expat.
But maybe I'm just reinterpreting a bit of passive racism in a nicer way