It's needed if you have a trailer that has/requires electric or electric over hydraulic brakes.
Federally, any trailer over 3K GVWR requires brakes (some states may be as little as 2K). Those are very often surge brakes so no controller needed. Used to be surge was good up to 6K though I believe they may have pushed that up to 9K. Over that it has to have electric or electric/hydraulic. You'll find those on trailers with disc brakes.
In the 7-pin bumper plug, there's a brake wire signal. Can also be used with 7-6 pin and 7-5 pin adapters to provide the brake signal. There are settings in the radio for type and "size" and stored trailers. The controller also has power settings 1-10 in .5 increments.
The OEM controller is also superior to aftermarket controllers as it knows about pedal pressure, ABS, traction control, yaw, anti-sway, etc.
There's a really good tech sticky over on HDRAMS if you really want to dig into it.
This post is about the brake controller on the 2021 HD Ram. First, my story. Second some reverse engineering and description of the warnings on the dash. Finally, some technical details. I would assume this information would apply to other years in the same generation of truck, but outside of...
hdrams.com