What is responsible for the patterns of motion of all celestial objects?

Gravity for the real motion,
the Earth's rotation for the apparent motion.