I work remotely. It's very simple - you position yourself and your skillset in such a way that you cannot be commoditized.
There are two essential skills required to manage your own freelancing or consulting practice. The first is the core competency for which you bill (software development, sales conversions, security auditing, etc.). The second is the ability to inspire confidence in your clients that you are capable of using that competency to solve a business problem. Perception matters a great deal in business relationships and framing yourself as an equal who will leverage a unique mix of skills to contribute value is very important.
'patio11 has spoken about this a lot, and his writings helped me get to ~$300k per year as a consultant.
To be honest I've never been in a situation where there was any such competition. I'm sure it happens on the margins but when you factor in time zone inconvenience, language and cultural barriers it isn't so easy to commoditize consulting. Also good people from anywhere in the world tend to migrate to a few places where this work is done. They don't always stay hanging out somewhere cheap. And good people aren't cheap even if they live in a low cost location. The market price for such people is driven by demanding vs supply rather than the cost of their apartment.