It's very simple, you scan your passport just like IO have with mobile apps, then it shows if you are OK, overstay or wanted. If that happens the light will be red instead of green and the gate won't open. A few IO can oversee entire rows of automated exit gates and will then obviously come to you, to further check you at a manual check-out. Simple as that.
In Netherlands they are even smarter, as you have to first get inside it, if you are then not good, you will be stuck in between of 2 doors like a cow who is about to get milked. Not sure if they also have those here soon.