In the motor of a car, gas heats up and pushes a piston. A black hole is capable of the same thing — back in the 1970s, Jacob Bekenstein and Stephen Hawking realized: black holes have temperature and entropy (a measure of hidden information, depending on the horizon area). This means they can be incorporated into a heat engine — you just need to compress and expand the 'space' around them.
The authors placed the hole in an imaginary sphere-cylinder. By changing its size, they made the hole perform work thanks to gravity. Due to time dilation near the horizon (redshift), the temperature on the walls changes in an unusual way. Modeling showed: the highest efficiency is achieved with cyclic heating and cooling; it is almost equal to the theoretical limit. However, due to quantum effects of the curved spacetime itself, absolute ideality is unattainable. This 'almost ideality' is extremely sensitive to details of geometry — such an engine could test gravity theories, since even the slightest errors would immediately show up.
It's not impossible that even the singularity inside the hole participates. The concept of the 'stretched horizon' by Kip Thorne anticipated such an approach.
At maximum heating, the losses of this engine are comparable to the friction of a single molecule — that's how close it is to the ideal.