For a given displacement, the more cylinders you have, the smaller each cylinder is. That results in smaller explosions that come more frequently than an engine with the same displacement but fewer cylinders. This will be observed by the driver as smoother power and torque delivery.
More displacement means more fuel and air in the cylinder, and therefore more power and torque at the expense of fuel consumption since this means that the pistons, connecting rods, and crank shaft are all larger and heavier.
V configurations offer the most compact packaging for a given displacement. This is why high-performance cars typically have V8, V10 or V12 engines. H configurations (Subaru, VW, and Porsche engines) make the engine very wide but can sit very low in the engine bay. An H configuration does not specifically impact engine performance, but does affect handling since the weight of the engine is so low in the car. I configurations make for the most difficult packaging for a given displacement. However, they also inherently produce the best torque. For this reason, they are very common in large trucks where there is plenty of space for a very long, very tall engine.
https://en.wikipedia.org/wiki/Engine_configuration#Piston_engines for general coverage.
Piston engines have mass that goes back and forth, hence the term reciprocating engines. Moving it back and forth generates reaciton forces. Engines for vehicles need to fit inside. An inline 6 is [naturally balanced](https://en.wikipedia.org/wiki/Straight-six_engine#Engine_balance_and_vibration) so runs very smoothly. But it is very long. A V6 needs balance weights to run as smoothly but is much shorter at the expense of being wider. Cars are fine with this squareness.
Horizontally opposed 4-cylinder engines are shorter in height than inline 4, so they can go in situations that where height is important, like light aircraft or rear/mid-rear engine cars like the VW Beetle.
Another aspect is maintenance. If valves and spark plugs are accessible all from the same side it can be easier in a road car.
Generally, larger displacement means more air moving through the engine and thus more fuel burning, for more power.
Like everything in engineering, there will always be tradeoffs in design priorities.
Engineering Explained https://www.youtube.com/@EngineeringExplained is a pretty popular YouTube channel focused on the engineering of cars. I will leave it to you as an exercise to find engine design videos.
If you have very few cylinders, but they are huge, you will have occasional problems with proper filling of the cylinder with an even mix of fuel and air. If you have the same displacement but its a lot of small cylinders (V16), then it is more expensive to make.
An inline six can have a longer stroke than a V6, but a V6 of the same displacement is lighter and of course, shorter.
Enzo Ferrari raced in the 1.5L class as a young man. There were 4-cyl and 6-cyl engines. These are small engines, 92 cubic inches. He decided to special order a 1.5L V12. It was expensive, but since each piston was smaller, it could rev to a higher RPM. In order to go to a higher RPM, you needed big valves that breathed well, so his engine wad a big bore and a short stroke.
When the Porsche 924 came out, they wanted to make it more affordable, so instead of a 3.0L six (which would be common), they made a 3.0L four cylinder, with four valves per cylinder to breathe better. Big pistons, but…not quite as smooth as a 3.0L six.
At the other end of the scale, Mazda made a tiny 1.8L V6 six cylinder, when 2.4L-3.0L would be more common. The world has millions of 1.8L 4-cylinder engines, so why make a more expensive engine if you need 1.8L of displacement? I don’t have an answer, but it was a real gem of a motor.
Latest Answers