What’s the difference between 4 wheel drive, rear wheel drive, and front wheel drive?

Are there any advantages or disadvantages to each of them, cuz when I drive the mustang dark horse (rear wheel drive) and the Lancer Evo X (4 wheel drive), I did a similar time. So I can’t tell whether there’s a difference and I juts suck at it.