I love your optimism.
Everything is fair and just. If you show you are a valuable resource that can't be replaced, then you have nothing to fear.
Of course, the people running the company will never make poor, short term, misguided decisions.
Let me tell you a story.....
I was working as an external consultant for a very large company. They have amazingly complicated business processes - in fact too complicated. I encountered a large issue caused by poor business processes , that was affecting multiple business units. For each individual business unit, there was an elevated cost, but taken over the all of the units, the cost was huge.
Now, I didn't have enough knowledge to be able to resolve this, but there was a developer who had work there for 10 years, had contacts with all of the business units affected. With his help, I was able to arrange a meeting with multiple department head - which for this organization was a big achievement. I explained the issue, and the huge costs that could be saved. The developer was able to provide a solution, but it would also mean the way that 3 units worked would have to be slightly changed. The amount of work involved wasn't large, but the logistics were extremely difficult.
So, what happened? This developer who have 10 years of business knowledge and could help save hundreds of thousands each year was let go. He was replaced by Infosys, and a team of people in India (yes, a team replaced one person - but, hey, it was still cheaper). Management didn't know and didn't care that the business knowledge was leaving. The developer was kicked out, then I left for another project in another company. The business practices were never changed, and the cost savings never occurred.
It's been two years since, and I've heard that the outsourcing isn't going so well, and they have approached my consulting company group if they could put in a bid to take it over and bring it back on shore.
but you can't outsource Dave Johnson, because there's only one of him.
And there was only one of this developer with the business knowledge. It didn't save his ass from being outsourced to India.
(By the way, the company got rid of their entire development group, not just this one guy. They lost other people who had more experience - these people knew what was happening a couple of years in advance, and so left, which ironically made the outsourcing decision easier, since the development group was at half strength anyway.)