To access the internet we need a DNS, or Domain Name Server. Similar to a phone book, the DNS has a list of IP addresses associated with websites, much like people and their phone numbers. IP addresses are strings of numbers which act as the address for physical hardware (servers, computers, phones), similar to phone numbers. When I type in a website, like google.com or netflix.com my request for that website is sent to my DNS, the DNS knows what IP address google.com belongs to, and gives me that IP address. From there I can “call” the website. Websites are hosted on servers, and those websites are accessed through their IP addresses. When I need to access a website, the DNS gives me its phone number so I can call it.
A pihole fits into this by serving the function of a DNS, however it has a list of websites which it blocks. When a user visits a website with ads, the website will need the ads to load separately, and call upon the websites which have these ads, the DNS server, or pihole has a list of websites that are associated with ads. The blacklist of non-permitted websites will deny the website access to the IP associated with the website, thus blocking the ads from loading.