"A cylinder is a crucial part of the engine where fuel is combusted and power is generated. It consists of a piston, an inlet, and exhaust valves at the top.”
To understand how cylinders work, you need to understand how an engine works. The engine is made of a set of cylinders and a piston. The engine has to go through a chain of four steps (a four-stroke) to power your car; Intake, Compression, Power, and Exhaust. During the Intake stroke, a piston moves inside the cylinder and the inlet valve opens so the fuel is mixed with air. The Compression stroke allows the piston to compress the fuel-air mixture, making it combustible. The Power stroke is a stage where the combustion happens causing a spark. At the Exhaust stroke, the outlet valve opens letting the piston back down and the exhaust gases out through the outlet. Thus, cylinders play a crucial role in generating power inside your engine by directing which pistons to move and when the fuel needs to burn.
In the case of an inline configuration, it is the same arrangement they used at the very beginning of the engine history. Inline cylinders are one of the most basic forms of cylinder arrangements. An inline 4-cylinder engine, for example, has the virtue of being small and light so it can be used on a variety of different drivetrains. Also, it causes fewer vibrations in your vehicle compared to other layouts, contributing to a smooth ride and comfortable driving.
Engines with a flat arrangement commonly use four or six cylinders. In this arrangement, as its name implies, cylinders are lying flat to the ground. Since the flat engine greatly reduces the center of gravity compared to Inline or V-shaped engines, your car is going to have much smoother handling and less vibration.