Why two customs/immigration controls?
In the last four days I've driven my motorbike from Milano to Kalamata going through a few nations on the east side of Adriatic sea, and in a couple of occasions I found myself crossing two customs to enter or exit a country (in both cases it was night, and cold, and I was freezing, and after driving for hours and hours, so I did not take note of which border...but probably entering Montenegro and exiting Albania)
Why is that? I noticed that in all occasions one custom asked for both my passport and my bike documents and the other custom asked for just my passport, but still it doesn't make much sense.
Best Answer
To add to @phoog answer, it's also possible that different agencies are in charge of customs (issues around import and export of goods) and immigration.
To give you two (somewhat outdated) examples, if you use the French sector of the train station in Geneva, you will walk through four different areas: French police and customs and Swiss border guards and customs. That's not the way it works anymore (among other reasons because Switzerland is now part of the Schengen area) but you can still see all four offices/booths along the corridor. Entering Switzerland from the other side, on the German border, I once underwent three different checks on a train: Local police, federal border guards and customs.
Pictures about "Why two customs/immigration controls?"
UK Border Force Customs Agents on the Front Lines | Border Patrol
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Rachel Claire, Nana Lapushkina, Heibby Cris Marvel, Jill Wellington