This is because the Earth is tilted on its axis at approximately 23.5 degrees. This tilt means that the sun's rays hit the equator directly at the two equinoxes (spring and fall), when the Earth is tilted neither towards nor away from the sun.
Throughout the year, the sun's rays strike different parts of the Earth most directly depending on the time of year and the Earth's position in its orbit.