I'm in the IT industry, and many companies are outsourcing it jobs to India, China etc. What can I do to secure my positions within the industry?
All of the things you say are true. There are billions of people in the world, and in a job market where location is decreasingly important, you are competing with more and more people for jobs. In the end, you're going to have to be better than those you're competing against.
So what can you do to differentiate yourself?
Don't believe the hype, the traditional differentiator - location still matters, even if it's lessened. Even in IT, people work in teams. Working in teams requires communication. Communication is always easier in person. "So put all of the Indians together!"; sorry, they have to get their requirements from somewhere, which requires communication. For you the OP, knowing the Swedish language, customs, and laws provide you with a distinct advantage over foreigners in this regard.
Beyond that, you can differentiate yourself by skill. The US went through an outsourcing binge around the turn of the century, and quickly found that not all programmers are made equal. Projects would go overseas and then fall apart. Work would be catastrophically broken or ill documented. Cheaper is worthless if people can't do the work.
Yes, you might have to take less money to compete. Yes, you might have to live somewhere with a lower standard of living to accomodate that less income. But remember that it works both ways: if you are truly exceptional, you have a whole world of companies fighting to hire you, not just the limited subset within commuting distance. Likewise, more and more people means more and more jobs.
In addition to what @Telastyn said, domain knowledge is extremely important.
Anyone can learn IT, but can they learn YOUR company's business, too?
More and more companies will need people who can walk "both sides of the line" where business meets IT. Become an expert in your company's financials, manufacturing process, or inside sales work.
Learning IT is a great skill, but it's a fairly easily-learned skill, based on a lot of memorization. The VALUE of IT is its ability to support business, either by reducing expenses, generating revenue, or improving capacity / efficiency with existing resources. Become an expert at that. It's easy to write a program to do a task. The value is realizing, "Hey, if we wrote a program to do X, it would cost us $5,000 to develop and let us ship 75 more units per week, increasing revenue by $750,000 per year and earnings by $300,000 per year. I can make that happen."
Think of it like learning to drive: Billions of people know how to drive a car. But 25 or so people are good enough drive a Formula 1 race car through a chicane at 200+ MPH less than a foot away from another car doing the same thing.
Almost anyone can learn to put up a server, connect it to a network, and set up user accounts. Can you see where one needs to be? Do you know which one to use? Do you know how much will be saved or accomplished if you do? Can you present that to the people who control the money?
THERE'S your long-term job opportunity.
I read the original post, since it was obvious it had been 'cleaned up' in various respects. A lot of people go off like that, and I heard a lot of it in the early 2000s in the US when legions of older engineers and developers were losing their jobs.
Given the planet's population of 7.1 billion, and roughly 65% are of working age and work, we're talking about 4.5 billion people in the global workforce. Of these, around 20 million are software developers. This is roughly one programmer for every 250 people in the workforce. There are probably 3 billion 'programmable devices' from smartphones to servers, which would suggest there are 150 boxes for every programmer on the planet. Fundamentally, there is more work than there are programmers. Computer hardware prices are declining at a good clip, even the cheapest software developers aren't getting any cheaper.
If one is seated in a cubie and finds more and more foreigners and fewer and fewer of their fellow countrymen in their team over the space of a few years, it looks scary. The litany I used to hear was 'why isn't our employer retraining us for current skills?'. Thus the old mainframe and Unix programmers were being dumped instead of retrained in C++ or Visual Basic or the web scripting languages, etc. One has to ask the people getting laid off what they were doing when they went home. I programmed on minicomputers in the 1970s and 1980s, learned dBase and FoxPro in the late 1980s, learned Visual Basic and relational databases in the mid-1990s, and learned web scripting languages in the late 1990s and early 2000s. I've been out of work, in some cases, for a few weeks in all that time.
Second, people from other countries don't know your banking laws, privacy rules, regulatory reporting, etc. Thus anyone trying to explain to them what you have to watch out for when writing a financial program won't be understood for awhile. In some cases the cultural barrier is a bit more stark - one company in the US makes 'comfortable work shoes for women'. While lots of companies make shoes for women, in some countries no one cares whether women are comfortable, therefore why would anyone make nice shoes for working women?
Third, ultimately your work is to solve problems. I run into a lot of people who think work is something you show up for, follow instructions, and go home at 5:00 PM. They pay no attention to their 'value proposition' - why does someone prefer me over any other employee? I would run into prospective clients that clearly needed some software work but couldn't tell me the brand of their server, the language their application was written in, or what kind of database it ran on. I've had meetings in which the people asking for software work could not articulate even the simplest requirement. In such circumstances it is good to know how to read minds, however these days that involves expensive equipment and a bunch of egghead academics. Failing that, one has to be a 'spy' - gathering clues from document flow, interviews, looking over people's shoulders, etc. Look at the questions posted by some of the 'foreigners' on this board, and tell me how close any of them are to doing this.
You secure what value you bring to the company and recognize that there may well be new positions over time. For the past 16 years, I've worked in North America as a web developer where while I've heard this line repeatedly and wonder how well do people really understand how the world works? There will be some positions outsourced and other jobs created instead. Some grunt work may be migrated and other work may be opened up. "The World is Flat" by Thomas Friedman has some good points on how some people may have new jobs that didn't exist years ago and I believe this trend will continue. 23 years ago, there wasn't the world wide web and 13 years ago there wasn't Facebook so new things will come along and the question is how well do you know which roles suit you.
I like solving problems and helping people. Thus, I enjoy working as a developer that fixes and builds systems for companies. While some work did get off-shored to 3rd world countries for a time, some of it came back as they realized the model of being partly on-shore and partly off-shore works better. Thus, there is still a rather good demand for various IT workers in parts of North America.
For all I know, I may end up becoming more of a mobile application developer someday that I'm pretty sure 20 years when people had big bricks for cell phones would have seemed ridiculous yet look where we are. You don't know the future but you should know what roles suit you and thus which kind of work you do well.