What's the difference? Blocking via VPN or DNS

I know these two technologies are different, but they boast the same selling points: block ads, trackers, and malware.

I recently discovered a third-party DNS service called “NextDNS” for my Android phone. While tinkering with it and researching it, I noticed it was pretty good at blocking ads in my mobile browser and for some of my Android apps as well.

My question here today is what is the difference between NextDNS’s blocking of ads, trackers, and malware vs. Proton’s NetShield technology that also claims to do the same?

I humbly submit that I could have no idea what I’m talking about. Can someone please help me understand?

NextDNS is a DNS level blocking service, which you can configurate as you please. You will use NextDNS servers as your DNS.

Netshield is a feature of Proton, that is also DNS level blocking. You just don‘t have the granular configuration options there. Upon connecting to the Proton VPN server, the VPN server acts as DNS server and also blocks on the DNS level.

This was the most helpful comment I’ve read about VPNs and DNS. Thank you!