Why does a car's speed decrease when going up a hill?

Because gravity is trying to pull it down hill...on flat ground gravity isn't pulling it either direction.