Basically, in old school automatic transmissions, a part called the valve body used a few variables like engine speed, throttle position and vehicle speed to determine what gear the transmission needed to be in and when to change gears. It would open and close different hydraulic circuits to turn different things (bands and clutch packs) on and off to get different gear ratios and ultimately gave us the automatic transmission. This was all done with no electronics and quite honestly blows my mind that it actually worked--it all worked on hydraulic pressure
Now, the bands/clutch packs are still controlled by oil pressure, but that oil pressure and what circuits are on/off are controlled by solenoids inside the valve body. The solenoids are controlled by the TCU (transmission control unit).
In the E60, the valve body, solenoids and TCU are all in one assembly called the mechatronics unit (I assume it's derived from mechanical valve body and electronics control spliced together or something like that).
On my E60 I had issues with the solenoids no longer sealing correctly--this is very common, however, BMW refuses to replace any individual components and will almost always only replace the entire transmission or entire mechatronics assembly, even when a few hundred dollars in solenoids would have fixed the issue. The video below shows me pulling the mechatronics unit and changing the solenoids. The black plastic piece in the video towards the end has the TCU built into it--you can kind of see how it connects to the solenoid once put back together.
Ultimately, if I could do it in my driveway on jack stands, I'm sure any decent mechanic could do it.
Just curious--what exactly is wrong with yours that makes them say the TCU is bad?