You’re correct. Pihole works at the DNS level. Since YouTube hosts their ads on the same servers that host their videos, blocking the ads with DNS would also block the videos. Which I guess it technically works to block YT ads, but that’s a little like saying “set a man on fire and he’ll be warm for the rest of his life.”