I always assumed it was attempting to suss out if you'd been fired, since that naturally leads to a gap in your resume (and depending on how in demand your skills are, could lead to longer gaps).
It's also possibly just normal curiosity - most people don't have gaps in their resume.