I use an app called MonitorControl on a M1 16" MBP running Sonoma that adjusts both the MBP screen and external HP 25f monitor. It adjusts the brightness and contrast of whichever screen the cursor is in.
Right, but that's part of the point. Apple should just have this inside macOS.
From MonitorControl's GitHub README, emphasis mine:
> Most modern LCD displays from all major manufacturers supported implemented DDC/CI protocol via USB-C, DisplayPort, HDMI, DVI or VGA to allow for hardware backlight and volume control.