If you look at the definitions of ride and drive:
to cause and guide the movement of (a vehicle, an animal, etc.): to drive a car; to drive a mule.
to convey in a vehicle: She drove them to the station.
to sit on and manage a horse or other animal in motion; be carried on the back of an animal.
to be borne along on or in a vehicle or other kind of conveyance.
This doesn't really provide an answer aside from, "because that's how we do it." The two distinctions you called out aren't even the weird ones:
- You can drive a mule but only without sitting on it. (If you sit on it, that's riding.)
- You can ride an animal while someone else drives it (from the ground).
- You can drive animals while riding on a different animal.
As far as vehicles, the distinction is usually how you position your legs.
- You ride on bicycles, motorcycles, all-terrain vehicles, rockets, railings
- You ride in cars, trucks, side-cars attached to motorcycles, shopping carts
- You drive cars, trucks, tanks and most other things you ride in (as long as you have control; so you don't really drive a shopping cart.)
Pilot is simply reserved for airplanes (airships), ships, spaceships and so on:
pilot — a person who steers a ship.
A more modern complication is what you call controlling a vehicle without being present:
- You drive an RC car
- You drive an RC motorcycle
- You pilot or guide a missile
- You merely fly an RC airplane
As with most issues surrounding terms like these, there is often debate about the appropriateness of one term over the other. The above is a good snapshot of opinions but you could spend quite a bit of time arguing for or against the particulars. The most debatable:
I drive my motorcycle to work.