When you enter a Schengen country, your name is run through an Interpol and a few other databases to see if you're on any watchlists (or if there are any flags tied to the document you're using). Your entry is recorded in a country's database, and there's some bilateral integration of databases.
Originally planned for 2020, by 2022 a common Entry-Exit system will allow for real-type sync-ing of entries/exits, eliminating the need to stamp passports.
https://en.wikipedia.org/wiki/Entry-Exit-System