If there are "excessively repetitive" clicks, those are filtered out by Google's system. If there are known sources of invalid activity, such as an IP address, those are automatically discarded, according to Google's advertising guide. Advertisers are not charged for clicks that Google determines to be invalid.
Below are 3 Major Ways How Google Does This:
1. IP Address Checking: Every time you log in to your Google Adsense account to edit your information or check your site's statistics, Google records the IP address of the computer you are using. Then, if a high number of ad clicks come from the same IP address, Google will usually flag your Adsense account since there is evidence that you are clicking on your own site's ads. Even if you log out of your Adsense account before clicking on ads, your IP address does not change and Google will likely consider all clicks from that IP address as invalid.