Why do some cars have their engines in the front and some in the back, what are the advantages and disadvantages of the two builds. And why doesn't every car have full wheel drive?
Front engine, rear drive is easy to build. Good driving characteristics until you lose traction in the rear, which isn’t hard because there’s not much weight back there. You get over steer which isn’t the easiest to deal with.
Front engine, front drive is cheap to build. Good driving characteristics until you start pushing the limits, then you get under steer which is easy to deal with by letting off the gas.
Rear engine, rear wheel drive. Same cost advantages of Front/front but has some quirky driving characteristics.
Rear engine, front drive: nope.
AWD: better driving characteristics, more cost and more weight.
Mid engine, rwd: similar to rear/rear, but costs more, better handling.
Worst possible space efficiency and somewhat tricky routing. Lots of parts and complexity. But arguably the best performance and balance if you can deal with the cost and mass. Not uncommon, see Lamborghini, Porsche.
Pretty much obsolete at the top tier, though, since electric motors can trivially distribute the weight and drive even better.