It was a term that came up in the Cold War.
1st World countries are the western democracies.
2nd world countries are the Communist countries in the Soviet bloc, as well as China.
3rd world countries were countries that were not aligned with the 1st or 2nd world.
The term first came about in the late 1940's in the UN.