Most companies will continually look at whether individual employees have the skills they need for the future, and also whether the employees could be replaced by someone else who they believe can do the job at a lower cost - whether offshore or onshore.
Most universities these days advise students that once they have stopped gaining skills and experience in their current position they should look elsewhere for a new role that will offer better pay and conditions and an opportunity to gain more skills and experience, that will enable them to increase their market value to employers.
Sadly many people who have stayed with companies for a long period of time find themselves in the position that the company believes their skills are not up to date and that they can be replaced with an alternative at a lower cost. In some cases the employer may be right, in others they may be overlooking the wealth of experience and knowledge their employees have accumulated.
If you want job security these days the best way is to keep your skills up to date, ensure you put your resume out in the market and find a better position, one which you will be able to improve you market value to potential employers - you will have two to three years before your new employer starts asking whether you can be replaced at a lower cost and by then you should be looking for your next role.
Your employer doesn't feel they owe you anything for your years of service, don't act like you owe them anything other than an honest days labor for an honest days pay - employment is a market value based transaction and if you don't recognize this you are likely to be surprised.
If your market value is more than your existing company wants to pay, then time to start looking. Your market value is your job security.