That's a good question. I don't think that they can really know that. They just have some algorithms for the obvious frauds.
They must have some system in place that alerts them if there is a sudden spike in clicks on your site. It must be someone's job to analyze sudden extreme variations in stats and determine if they are fraud or valid.
How do Google differentiate real clicks vs fraud clicks is what Adsense is really about. The mechanisme and the algorithm they design are subjectively related to Adsense Secrets.
I have some secrets, but I am not going to share them What I will say is that Adsense is fun, so play with it
I don't think there are any secrets to know... Don't try to cheat on the system, play it fair, create quality content and traffic and the income will come naturally !