Here's why:
* Earth's Orbit: Earth orbits the Sun in an elliptical path.
* Moon's Orbit: The Moon orbits Earth, also in an elliptical path. This orbit is tilted at an angle of about 5 degrees relative to Earth's orbital plane (the plane of Earth's orbit around the Sun).
This means that the Moon's orbit is like a tilted, slightly wobbly circle that goes around Earth, while Earth itself is going around the Sun.
Think of it like this: Imagine Earth is a merry-go-round, and the Moon is a toy car going in circles around the merry-go-round. The merry-go-round is spinning around a central pole (the Sun), and the car is tilted at a slight angle. The car's path around the merry-go-round would appear curved and wavy when viewed from the central pole.
Because of this, the Moon's path with respect to the Sun looks like a complex, curved, and slightly wavy line, not a straight line.