(CNN) Hundreds of thousands of migrants are pounding on Europe's invisible doors -- dirty, exhausted and desperate to escape the daily carnage in their homelands.
But their arrival also puts a strain on European resources. Germany expects to take in 800,000 refugees and says it will spend at least 6 billion euros ($6.7 billion). Austria, which received 16,000 migrants in just two days, said it won't be able to keep up with this pace.
At the same time, several oil-rich Arab nations closer to the conflict zones have come under harsh criticism because they've taken in virtually no refugees.
So are countries obligated to house refugees? If so, why?
For the most part, it boils down to an international treaty.
What does the treaty say?
Europe's migration crisis in 25 photos
A woman cries
after being rescued in the Mediterranean Sea about 15 miles north of Sabratha, Libya, on July 25, 2017. More than 6,600 migrants and refugees entered Europe by sea in January 2018,
according to the UN migration agency, and more than 240 people died on the Mediterranean Sea during that month.
Refugees and migrants get off a fishing boat at the Greek island of Lesbos after crossing the Aegean Sea from Turkey in October 2015.
Migrants step over dead bodies while being rescued in the Mediterranean Sea, off the coast of Libya in October 2016. Agence France-Presse photographer Aris Messinis
was on a Spanish rescue boat that encountered several crowded migrant boats. Messinis said the rescuers counted 29 dead bodies -- 10 men and 19 women, all between 20 and 30 years old. "I've (seen) in my career a lot of death," he said. "I cover war zones, conflict and everything. I see a lot of death and suffering, but this is something different. Completely different."
Authorities stand near the body of 2-year-old Alan Kurdi on the shore of Bodrum, Turkey, in September 2015. Alan, his brother and their mother
drowned while fleeing Syria. This photo was shared around the world, often with a Turkish hashtag that means "Flotsam of Humanity."
Migrants board a train at Keleti station in Budapest, Hungary, after the station was reopened in September 2015.
Children cry as migrants in Greece try to break through a police cordon to cross into Macedonia in August 2015. Thousands of migrants -- most of them fleeing Syria's bitter conflict -- were stranded in a
no-man's land on the border.
The Kusadasi Ilgun, a sunken 20-foot boat, lies in waters off the Greek island of Samos in November 2016.
Migrants bathe outside near a makeshift shelter in an abandoned warehouse in Subotica, Serbia, in January 2017.
A police officer in Calais, France, tries to prevent migrants from heading for the Channel Tunnel to England in June 2015.
A migrant walks past a burning shack in the southern part of the "Jungle" migrant camp in Calais, France, in March 2016. Part of the camp was being demolished -- and the inhabitants relocated -- in response to unsanitary conditions at the site.
Migrants stumble as they cross a river north of Idomeni, Greece, attempting to reach Macedonia on a route that would bypass the border-control fence in March 2016.
In September 2015, an excavator dumps life vests that were previously used by migrants on the Greek island of Lesbos.
The Turkish coast guard helps refugees near Aydin, Turkey, after their boat toppled en route to Greece in January 2016.
A woman sits with children around a fire at the northern Greek border point of Idomeni in March 2016.
A column of migrants moves along a path between farm fields in Rigonce, Slovenia, in October 2015.
A ship crowded with migrants
flips onto its side in May 2016 as an Italian navy ship approaches off the coast of Libya. Passengers had rushed to the port side, a shift in weight that proved too much. Five people died and more than 500 were rescued.
Refugees break through a barbed-wire fence on the Greece-Macedonia border in February 2016, as tensions boiled over regarding new travel restrictions into Europe.
Policemen try to disperse hundreds of migrants by spraying them with fire extinguishers during a registration procedure in Kos, Greece, in August 2015.
A member of the humanitarian organization Sea-Watch holds a migrant baby who drowned following the capsizing of a boat off Libya in May 2016.
A migrant in Gevgelija, Macedonia, tries to sneak onto a train bound for Serbia in August 2015.
Migrants, most of them from Eritrea, jump into the Mediterranean from a crowded wooden boat during a rescue operation about 13 miles north of Sabratha, Libya, in August 2016.
Refugees rescued off the Libyan coast get their first sight of Sardinia as they sail in the Mediterranean Sea toward Cagliari, Italy, in September 2015.
Local residents and rescue workers help migrants from the sea after a boat carrying them sank off the island of Rhodes, Greece, in April 2015.
Investigators in Burgenland, Austria, inspect an abandoned truck that contained the bodies of refugees who died of suffocation in August 2015. The 71 victims -- most likely
fleeing war-ravaged Syria -- were 60 men, eight women and three children.
The 1951 Refugee Convention was adopted after World War II, when hundreds of thousands of refugees were displaced across Europe.
The treaty defines what refugees are -- those who is seeking refuge from persecution. It also gives them a very important right -- the right to not be sent back home into harm's way, except under extreme circumstances.
"Since, by definition, refugees are not protected by their own governments, the international community steps in to ensure they are safe and protected," said the UNHCR, the United Nations' refugee agency.
The treaty was amended in 1967, in part to include refugees from around the world.
And according to the provisions, "refugees deserve, as a minimum, the same standards of treatment enjoyed by other foreign nationals in a given country and, in many cases, the same treatment as nationals," the UNHCR said.
The agency said more than 50 million refugees have been resettled.
Why migrants head to the Mediterranean
Who has signed on to the treaty?
Over the past several decades, 142 states have signed on to both the 1951 Refugee Convention and the 1967 protocol.
Hungary is one of the signatories. But it has been criticized by migrants and activists who say refugees are left in decrepit conditions as they await transfer. Now, Hungary is erecting a fence at the Serbian border to help control the flow of migrants.
Countries outside of Europe are also stepping up to handle the current flood of refugees. Venezuela, which signed on to the 1967 protocol, said it will take in 20,000 refugees. Australia said it has absorbed 4,500 refugees from Syria and Iraq over the past year.
Noticeably absent from the list: the Gulf states of Saudi Arabia, Kuwait, Bahrain, Qatar, Oman and the United Arab Emirates.
How you can help in the migrant crisis
How many refugees has Europe taken in this year?
Well over 366,000 refugees have crossed the Mediterranean Sea to Europe this year, the UNHCR said. Another 2,800 attempted the journey, but either died or disappeared.
The vast majority of refugees come from three countries: Iraq, where migrants are fleeing the brutality of ISIS; Afghanistan, which has been devastated by war; and Syria, where civilians are grappling with both ISIS and indiscriminate attacks in the country's civil war.
A country-by-country look at the crisis
What rights do refugees have?
In addition to not getting sent back to their home countries, refugees have several other rights, including:
- The right to not be punished for illegally entering countries that signed on to the treaty
- The right to housing
- The right to work
- Access to education
- Access to public assistance
- Access to courts
- The right to get identification and travel documents
Why aren't Gulf countries taking in refugees?
Since oil-rich Gulf states are close to Syria, Iraq and Afghanistan, they'd help absorb some of the refugees, right?
Wrong.
Saudi Arabia, Kuwait, Bahrain, Qatar, Oman and the United Arab Emirates have each given millions of dollars to the United Nations to help Syrian refugees. But they haven't housed any of them, according to Amnesty International.
"We've been asking that not only the borders of the region are open, but that all other borders -- especially in the developed world -- are also open," said Antonio Guterres, U.N. High Commissioner for Refugees.
Abdul Khaleq Abdulla, a retired professor from United Arab Emirates University, said Gulf states have security on their minds.
"Having refugees also feeds into ISIS' appeal," Abdulla said. "And it feeds into the violence in the region, which is already the most violent region on Earth. So all in all, anything that goes in the neighborhood impacts the security and the stability of the Arab Gulf states who are by far the most stable and the most secure."
And those Gulf states aren't party to the international treaty -- so technically, they don't have to help.
Things to know about Europe's migrant crisis
CNN's Becky Anderson and Arwa Damon contributed to this report.