Because publishers have control of the website, they can do things like randomize the div name, parameter names, javascript names, javascript functions, sizes of the ad, randomize images for the ad, use dynamic JS positioning, etc..
Basically if a publisher was serving their own ads and didn't want them blocked, you would be extremely hard pressed to counteract it.
As far as building your extension- You cant build it so its automated. No matter what you build, Any publisher could bypass it within minutes. The best you can do is make it so the site doesnt work if ads are showing, but publishers are already fine with this (hence why warnings are put up saying 'disable adblock to continue')