Four cylinder engines are great compact engines, which can fit in many engine bays, are easy to work on, and have balanced primary forces. The secondary forces of I4 engines are not balanced, however, reducing the overall size they can get to without the use of balancing shafts. Also, I4’s have a high center of gravity.
source/image: Engineering Explained
One of the interesting things about inline four cylinders is why the pairs of cylinders move in the way that they do, with the inner two pistons moving up and down together, as well as the outer two pistons moving up and down, opposite the inner cylinders.
Now part of the reason this is done is because for an even firing interval, you want to fire every 180 degrees, so you need at least one cylinder at top dead center for every 180 degrees of crankshaft rotation. But this flat-plane crankshaft is chose to keep the engine balanced and minimize vibration.
You can see that for first order forces, the pistons moving up and down opposite one another balance each other out. That said, for secondary forces, the forces do not balance out, as they point upward at both top dead center, and bottom dead center. This tends to limit the size of inline four cylinder engines, because as they get larger and rev higher, they tend to vibrate more. This can be countered using balancing shafts, but that means a more complex engine design.Engineering Explained