I've been asked how this works.
Internet browsers (every one that I've tested) uses the "hosts" file for domain name resolution, FIRST, before going to domain lookup online.
When you type a text web address, the browser needs the corresponding numeric IP address. The browser has to get it someplace, right? Everyone assumes that it is acquired online, as they have seen the messages to that effect.
Fortunately, the IP address can be provided by the "hosts" file, if you add them to it. The only primary advantage is faster access, since web-based domain lookup is avoided. This was the initial reason for the "hosts" file.
If, however, you put a text web address in the "hosts" file, and provide the WRONG numeric IP address, the browser will go to the wrong address. If you look at the example I provided above, and look in your own "hosts" file, you will see that the numeric IP address provided, for EVERY entry is, "127.0.0.1"
"127.0.0.1" is the IP "home" address for your OWN COMPUTER !
This causes the browser to look for files on your computer - files that aren't there.
When an advertisement is supposed to load, the browser can't find it (on your computer,) so it just skips it. (Some browsers show an error message, some just a blank graphic box.)
By the way, you can download "hosts" files, from online sources, that are already packed with hundreds of the the most common "bad actors." I've been doing this for decades; long before ad-blocking software came along. If you find yourself blocked from a necessary website, edit the "hosts" file, to permit routing to the proper address.
-Taff