In several questions, I read that there are additional validity restrictions for the passport if you visit a foreign country: e. g., a country requires that your passport is valid for at least 6 months after your planned departure.
This restriction seems to be imposed by many countries.
What is the background of this requirement? I mean, a valid passport is a valid passport. And as long as my passport is valid, it should be fine, shouldn't it?