It is actually due to the presence of the Moon. The Earth and Moon both orbit every month around a point called the Earth-Moon barycenter, which is on average about 4700 km (2900 miles) from the Earth's center. Because perihelion and aphelion are defined by the distance between the center of the Sun and the center of the Earth, the Earth's position in its monthly motion around the Earth-Moon barycenter greatly affects the time of perihelion and aphelion. Due to the fact that the position of the Moon doesn't repeat from year to year on the same date, neither does the position of the Earth with respect to the Earth-Moon barycenter. This produces what appears to be a quasi-random variation in the dates of perihelion and aphelion.