You need to make yourself as valuable as possible to your employer in any job market, but especially a market like the current one where there are lots of people eager to have a job. Being good technically is only going to get you so far though. Technical skills are relatively easy to replace because searching resumes and interviewing people will eventually get an employer the technical skills they need. You set yourself apart by understanding the organization, building relationships and getting to know the industry.
If all you offer your employer is the ability to write good PHP or to administer SharePoint or to fix computer problems, you can be replaced relatively easily. Yes, there is transition time to hire and retrain someone for an organization, but the pain in replacing someone is less about finding someone with the right technical skills and more about finding someone who fits culturally.
To protect yourself in your current position from being outsourced or easily replaced, you need to provide value to the organization that goes beyond your technical skills. Get to know the business processes of the organization. Try to understand who does what and why they do it. If you have an opportunity to attend a conference for your organization's field, do so. Gaining a perspective on the industry is as important as understanding the business.
Make connections to other people in your organization. If you know who the experts are or who other people see as informal leaders, you should make sure you maintain good relationships with those people. The more readily you know who to talk to about a process, the more ingrained you become to the organization.
All of these ideas do more than just protect you. They allow you to deliver more value to the organization. When you understand the organization better, you are better able to see the long term and make strategic recommendations or provide cautionary advice before an IT service becomes an obstacle to the organization. So while you can do these things to benefit yourself, also remember that you are benefiting the organization, too.