There are normally multiple cylinders which operate out of phase with each other: that is, while one is in the intake phase, another is in compression, another is in combustion, and so forth. Part of the work done by the combustion phase in a cylinder is to move the pistons (by means of a turning wheel called a crankshaft) of the other cylinders in their other phases.
One weakness of the Otto cycle is that it relies on the timing of spark plugs: if the gas is ignited too soon or too late in the cycle, the operation is not as efficient as it should be. Another problem is that the gasoline must not be allowed to get too hot during the compression phase, or else it will pre-ignite before the spark occurs, with the same problem. Diesel engines avoid both these problems: it compresses its fuel much more than in the Otto cycle until the fuel ignites on its own, without a spark plug. Diesel fuel burns at much higher temperatures than gasoline, and as we discussed in Heat Engines, a hotter reservoir results in higher efficiency.