Wirelessly posted (Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413 (KHTML, like Gecko) Safari/413 es61i)
Yes, they do know when you enter and leave the UK. All passports are scanned on entry, and airlines have the responsibility to scan them on departure. The data is then correlated by immigration (or whatever they're called now). The stamp is little more than a manual backup and souvenir.
if you overstay, you will have problems returning, or applying for future visas, etc. There's little sense in deporting already departing passengers.