The battery charging isn't that complicated TBH not like the advanced cowpiss injection system (AdBlue diesel exhaust NOx reduction). It's mainly software monitoring stuff that is already been measured anyway. You pay to write the software, you pay to test it, you pay to fix bugs. But once written and suitably bug free enough to release on paying customers you only need to recover the development costs and it's then free to fit.
The AdBlue system has lots and expensive components in it. It's why you pay (through the nose) for the extended warranty. The AdBlue fluid is not expensive as mine did 20500 miles before it told me I could start topping up the tank.