so I wonder how ad block is implemented?

The job is done by the server if i understood correctly.