When the work requires in-person presence, you're essentially competing against the people who can also attend your workplace - locals and those willing to relocate. When the work can be done remotely, the competition is naturally bigger. Obviously, if we're not talking about applying somewhere new, then there are costs of replacing an already onboarded employee which can be quite prohibitive etc, so you have a natural advantage.
However, most importantly, all this applies only if people compete for your position. I believe, still, software engineering is one blessed and super-privileged industry where there is a lot of money and significantly more demand than supply for higher-skilled folks (although I've heard junior-level job market is pretty saturated and situation there is quite dire). So if you are in such conditions, and assuming your performance (and value to the company) does not suffer, getting outbid is not an exactly probable event.
[Added a bit later] Unless your company is not doing well and is looking ways to cut corners. Then - yes - getting replaced with someone cheaper that's not exactly improbable. So, keep an eye and year for company's health - and be aware that some executives could lie straight to your face how everything is amazing while simultaneously thinking of how it's best to abandon this ship in a most profitable manner.