Answer:
There is a heating element in the kettle. As the water boils, the inner temperature of the kettle rises. Once the boiling temperature is reached, a small thermostat is triggered which turns the kettle off, so as to not boil continually. This thermostat works optimally with the lid on the kettle fully closed, if the lid is not fully closed, it does not switch the kettle off as quickly.