Possible to forward only local-domain requests to specific upstream server?

Thanks so much for the reply. I've also read your other post on conditional forwarding but I'm a bit confused on how it works.

How does Pi-Hole determine if a request is for a local machine versus a remote machine?

I'm running Pi-Hole in a podman (docker?) container on my UDM Pro with a static ip address. How does it know that "myserver.home.mydomain.com" is a local request versus "www.google.com" ?

I see that Pi-Hole asks for the local network in the conditional forwarding setup but I still don't see how that helps Pi-Hole understand if a request is for a local network machine.

EDIT: It looks like on my setup I need to specify the "Local domain name" otherwise all requests are going to the public/primary DNS servers.

Thanks so much for the help!