The EU Pact on Migration and Asylum is the mechanism used to distribute asylum around member states.
Factors considered when relocating refugees include population, GNP, and the number of asylum applicants in the last five years. Countries with larger populations tend to receive more refugees.
Hungary is hardly a place asylum seekers want to go. They subject asylum seekers to appalling conditions in order to deter them. Hungary is barely a democracy.
Then there is also the question of where the refugees themselves want to go. If the majority aim for Germany, what will stop them?
According to the Dublin agreement, asylum seekers should make their application in the first EU country they enter. Accordingly, Germany can send them back.
The perpetrator from Solingen was supposed to be sent back to Bulgaria because that’s where he had entered the EU. On the day he was supposed to be deported, he simply absconded from his accommodation and stayed in Germany.
Then Germany should have detained him before deporting him.