How can a company find out? A few TRUE stories out of my own experience:
A former co-worker of mine was hired by my new employer and placed in my department.
Due to a merger, my old boss, who had left to go to a competitor, became my new boss.
The company I used to work for was a vendor of my new employer, and the representative taking care of the new employer was my replacement.
My employer hired a former co-worker of mine as a consultant.
My father's next door neighbor was hired as the new COO of my company.
A co-worker quit to go work for a company that my (eventual) new employer worked with. When I innocently said, "Oh, I know someone who works for you; her name is Claudia Smith" the representative said, "Claudia was fired on her fourth day of work".
There are any number of ways that an employer can accidently find out about your previous employment. What if your boss plays golf with your old boss? What if they belong to the same professional organization? What if they have a friend in common?

