I'm pretty certain that the ATV remote beams good old fashioned infrared signals to change the volume on your TV/soundbar/receiver directly without involving the ATV itself.
The Apple TV remote doesn't emit infrared. The Apple TV does that itself! (This means that "learned" remote commands work even if you're controlling the Apple TV with your phone, or with a Bluetooth controller.)
I find that hard to believe, but I'm willing to be wrong. My Apple TV HD is in a cabinet with solid sides and doors (3/4" MDF). The television is wall mounted above it, outside the cabinet, and maybe 12" behind the Apple TV. And yet the Siri Remote controls the volume on the TV. I'm pretty sure it's using IR from the remote to the television to control the television's volume. I guess there's some small chance the volume is being controlled with HDMI ARC, although I've never been able to get my iPhone to control the volume on the television.
Unfortunately I can't find any definitive source on the internet to confirm exactly what's going on.
I think this is right, because I had to teach my remote how to talk to my tv. Super odd, since every other box I've had has just been able to do this over HDMI.