This toy is a mini Sterling Engine. It demonstrates the cyclic process of a heat engine. Heat is taken in from the hot plate, partly converted into mechanical work to turn the wheel, and partly “wasted” as heat dumped to the cold plate.
See xmdemo.wordpress.com/147 for detail