Watch UK Border Force, and you will see that many deportation cases turn on whether the person's travel documents can be found. So when they round them up at a workplace, say, they investigate to try to figure out where they live, then they enter that domicile and search it exhaustively.
If they are able to find a genuine passport, it's a straightforward affair -- into the detention van they go, and they are detained and deported fairly quickly.
If they are unable to find travel documents, that puts them in a quandary. They can't deport them to a country they only seem to be from. They must get the person's details, contact the foreign country, and try to get the foreign country to confirm they are a citizen and send over travel documents.
A country like Canada would cooperate, however a country like Bangladesh has a pretty good deal: their citizen is implanted an affluent first world country, making a fantastic wage (by home standards), and sending much of it home to Bangladesh. So there is a perverse incentive for Bangladesh to not help the UK sort out their citizenship.
On the TV program, you often see the Border Force give them a strongly worded admonishment not to seek employment in the UK... And resignedly let them go. Because realistically they do not have the detainee space to hold people for the extended time it might take for the home country to produce.
And the people seek work immediately, of course.
You can imagine the same occurs for people caught at the airport; the government can't detain them potentially forever, so they release them into the general public, with that same stern admonishment.
So for someone illegally in the country who aims to stay, it is definitely in their interest for their proper passport to disappear. I could see a traveler wanting to retain it in a secret place for when they want to travel, but that is impossible at the airport.