It happens when someone traveling on the world map comes near you and enters your encounter. If you ever spot an encounter that says 'wastelander' that's another player. There's no surefire way to avoid it, you just have to be prepared to fight (or run like hell). The only advice i can give is to hunt away from the paths between major towns.