I once knew a guy who was fiddling sickness benefit while staying long term in Thailand. He told me that when they pulled him in for questioning they knew exactly where he'd been. The bit that stuck out for me was they said that on such-and-such a day you were stamped in and out of Cambodia. He had obviously done a border run that day and they knew.
Now, I'm not saying they trace all of us but I reckon if they want and have reason to then they can find out where you've been