How did 外国人 become 老外?
As Wikipedia mentioned, “老” is an empty prefix. Laowai is neither positive nor negative.

Actually, the word is often used to refer to a variety of races like Caucasians, Indians, Africans and Middle Easterners, who look drastically different from Asians. You will rarely hear a Chinese person call Japanese, Koreans and Filipinos 老外. That's why you hear some Chinese use this term even in the United States and Canada.

The word emerged in Beijing and became popular there. In southern China it is used less. 

What's the reason you hear this word used frequently in China? Because westerners attract more attention in the public as they look different. The quickest way to refer them is with 老外. Saying 外国人 is too formal.

The word might become less popular when more foreigners start living in/visiting China. It'd be less strange to see them in the public. 

The word is also used less among those who are better educated. He has a name, why call him 老外? Regardless of whether the word is negative or not, saying such is not really polite.