As an indication, you can look at this illustration:
the appendix H (Heat), is perhaps a bit of an misnomer.
the MGU-H harvests the energy of the exhaust gas flow, which is mainly pressure/velocity, but it is the heat of the combustion process, that causes the pressure (first inside the cylinder) and then when the exhaust valve opens, the gas exits the engine. The Exhaust flow has velocity and heat, but the turbo and the attached MGU-H making more use of the velocity, not the heat directly (like a Peltier element would do). It's more like a windturbine. The gas velocity, get's slowed down, by the turbine, which causes a slight increase in pressure. This turns the turbine.
On the other side of the turbine (connected via a shaft) you have another turbine, the compressor, which compresses air to feed into the engine.
But, and this is the "trick", because the fuel flow in this engines is limited, you have more energy in the exhaust flow, then you need to drive the compressor.
You can think of it like, having a windturbine on the top of your roof, which rotates in the wind, you use this rotation to pump water for your house.
What would happen if you have strong wind? You would pump more water, but at one point you don't need more water, so what now.
If you don't do anything, you will flood your house, because you keep pumping more water then you need. So you need to slow down the turbine, by "giving it more work to do".
So, every time you have too much wind, you connect, a generator on top of your watermill to the windmill. The extra load, makes sure, that you don't get more water then you need, but you make use of the extra energy which is there to be harvested from the wind.
In a nutshell, that's what the MGU-H does. Every time, when there is more energy in the exhaust flow, then you need to drive the compressor, it provides an additional load to keep the compressor speed ( and thereby the boost pressure) in check, and produces electricity instead.
The electricity which get's produces, can either be fed into the ES (battery) for later use, or it can be directly transfered to the MGU-K and help to propel the car forward.
The car is then driven to some part by the "engine" (ICE) and to another part via the MGU-K (electrical motor), which is then called hybrid drive.