Why do we use pylons to mount the engines on jetliners?
Engine placement was a tricky question when jets were introduced, and much has been learned since then. The initial idea was to mount them inside the fuselage or wing root. When they grew too big, they were closely mounted to the wing ("underslung" position, like in the Me-262, the Il-28 or the early Boeing 737).

However, the underslung position has two disadvantages:


More of the leading and trailing edges is obstructed, blocking space that would otherwise be used for slats and flaps. Consequently, an underslung position reduces maximum lift.
The center of gravity of the engine is too far back. Moving it more forward helps to place the center of gravity of the wing ahead of its elastic line. Bending will now create an opposing inertial moment, which is very helpful to dampen flutter.


Starting to move the engine downwards away from the wing initially increases drag, because now a narrow slot opens between both with a tendency to separated flow. Only when the engine is moved downwards enough, the drag of the wing-engine arrangement reaches its minimum. This placement was chosen in the next generation of jets like the B-52 or the Boeing 707.

Moving it still further down makes the pylon longer and thus increases the total drag again.

The big diameters of modern high-bypass ratio engines make it impractical to move it down enough to reach the drag minimum, but by moving it forward, the engine can again be lifted up, so a shorter landing gear becomes possible. Vortex generators are added if that pesky separation between engine and nacelle cannot be avoided.