Another description (for a gasoline engine): In order to make power you have to combine air and fuel, and burn it. However, for every part of fuel, you need ~14 parts of air, so by far the biggest problem is how much air you can fit into the engine.
That's the main reason for why the pistons, cylinders, runners, exhaust...indeed the engine, is as big as it is.
In order to fit in as much as possible, you also make the air passages smooth and just design everything so that as much air as possible can make it from the atmosphere to the cylinder in the split second that it has to do so.
In order to control the power, you simply place a controllable restriction somewhere in the system so that less air fills the cylinders. You control this restriction with the accelerator. In modern systems, the computer adds the appropriate amount of fuel. In old-school systems, a carburetor was used.