A foreigner is someone from another country. A foreigner is not from these parts.
Things that are foreign are different and unknown to people. Likewise, a foreigner is someone from a different country. An American visiting China is a foreigner. A German person visiting Canada is a foreigner. Foreigners are often tourists who check out the sights of other countries. If a foreigner decided to relocate to another country, they become an immigrant and perhaps eventually a citizen.