How many google ads are on github or stack overflow compared to the other pages you find? They know exactly what every little change to the algorithm does to their bottom line.
Search doesn't have to concern itself with AdSense ads, search ads still make up something like %85 of Alphabet's total revenue
The worst sites a.k.a. those a user might want to block are probably also bringing Google disproportionally large amount of income is my guess.