Well, it stops your ISP from snooping on you by seeing what DNS requests you make. It also stops any other MITM from seeing your DNS requests. They can see that you made one, but not to which site you requested.
Basically, a DNS request means you asked for the IP address of a website's domain name.
For example, to go to
https://linux.org you send a DNS request asking for the IP address of the site. The
Domain
Name
System spits out 172.67.153.107 and that's where your browser takes you - while leaving the plain text domain name in the address bar. (Some sites can be visited with just their IP address, this is not one of them.)
Of course, the people providing the DNS over HTTPS (DoH) can see your DNS requests. This just eliminates the man in the middle, such as your ISP, from seeing which specific site you requested.
I think that's how it works. I'm pretty sure. I read a ton of info when this was first being considered.