An induction cooktop (a cooktop is called a “hob” in European countries) is simply an electromagnet you can cook with. Inside the glass cooktop, there’s an electronically controlled coil of metal. When you turn on the power, you make a current flow through the coil and it produces a magnetic field all around it and (most importantly) directly above it. Now a simple direct electric current (one that’s always flowing in the same direction) produces a constant magnetic field: one of the laws of electromagnetism is that fluctuating magnetism is produced only by a constantly changing electric current. So you have to use alternating current (one that keeps reversing direction) to make a fluctuating magnetic field that will, indirectly, produce heat. And that’s all that an induction hob does: it generates a constantly changing magnetic field. It does not generate heat directly. You can put your hand on top of it and you won’t feel a thing.
When you stand a suitable cooking pan on top of an induction cooktop that’s powered up, the magnetic field produced by the cooktop penetrates the metal of the pan. So we have a fluctuating magnetic field moving around inside a piece of metal (the base and sides of the pan)—and that makes an electric current flow through the pan too (that’s all that induction means). Now this is not quite the same as the electric current that flows through a wire, carrying electrical energy in a straight line from (say) a battery to a flashlight bulb. It’s a kind of whirling, swirling electric current with lots of energy but nowhere to go; we call it an eddy current. As it swirls around inside the metal’s crystalline structure, it dissipates its energy. So the metal pan gets hot and heats up whatever food is inside it, first by conduction (it passes its heat energy directly to the food) but also by convection (liquid food rises and falls in the pan carrying heat with it). Read more about heat transfer in our main article about heat energy.