Originally, it is right that retarders were introduced to just having a non-destructive brake by just wasting the energy. That was around the 1980s. This was just to save maintenance cost as brakes were a big part of that costs.
The trucking industry is about costs and every little penny you can safe. So, years ago it started: Why do we waste that energy and do not re-charge the battery with that, because that reduces load from the generator and that will reduces fuel consumption?
Retarders have a huge impact in costs when your are counting miles. Retarders are having the disadvantage you can't brake to full stop with them. That's why they never worked in cars, because they are always additional to conventional brakes. So they add complexity and weight, both of which you want to reduce in cars.