You generally do present your passport when leaving. Most places you get an exit stamp (which matches your entry stamp). They usually confirm things such as not overstaying a visa.
ex:
overstaying in Thailand results in a on-the-spot fine
China lately has exit checks when traveling to SEA (they try to intercept people traveling to scam centers)