Asylum is a form of protection that allows individuals to remain in a country, provided that they meet the definition of a refugee. Eventually, they may become permanent residents or even nationals.
People seeking asylum in another country do so because they have been persecuted or fear they will be persecuted on account of their race, religion, nationality, membership in a particular social group, or political opinion. They usually petition for asylum when they enter a country, and the government of the country decides on a case-to-case basis, according to its own rules, whether or not to grant asylum to a particular person. A person has to fulfill certain conditions before being granted asylum. These conditions differ widely from one country to another. Some countries have a very restrictive policy.
When asylum is denied, states usually deport the asylum seekers, back to their own country or to a third country. During the period leading up to the decision whether or not to grant asylum, states often detain the asylum seekers (and their families and children) in special prisons. Nevertheless, many failed applicants manage to remain illegally in the country. However, whether deported or gone underground, failed asylum seekers often lead miserable lives. And then we forget all those that didn’t make it to the country of application. Asylum seekers often undertake hazardous and fatal journeys.
People have a right to asylum (see article 14 of the Universal Declaration). It’s a very old legal notion (e.g. the medieval church sanctuaries). The grounds for asylum are however, rather limited. There should be some kind of persecution. An important question is whether economic refugees should be given asylum. I think they should. Poverty is just as much a violation of human rights as forcing someone to change his or her religion.
However, unrestricted economic asylum does not seem to be possible. Flooding rich countries with millions of economic refugees will not help anybody. It will destroy economic welfare in the few places where it exists, without offering any real improvement for the disadvantaged.
The same is true for other kinds of refugees. In principle people should be protected, whatever their origin. But of course, a state is no longer obliged to grant asylum if the applicants are so numerous that accepting all of them would lead to chaos and economic problems in the receiving country. Accepting them anyway would mean sacrificing the rights of the people of the receiving country without being able to do much in favor of the rights of the refugees.
Combating human rights violations in the country of origin is the best way to solve refugee problems. Most people do not want to flee, so accepting them as refugees is not the best solution from their point of view, even though it is still better than not accepting them and it makes it possible to protect their rights.