This optimal positioning occurs when Mars is almost directly opposite the Sun in the sky. Since the Sun reaches its greatest distance below the horizon at midnight, the point opposite to it is highest in the sky at the same time.
At around the same time that Mars passes opposition, it also makes its closest approach to the Earth – termed its perigee – making it appear at its brightest and largest.
This happens because when Mars lies opposite the Sun in the sky, the solar system is lined up so that Mars, the Earth and the Sun form a straight line with the Earth in the middle, on the same side of the Sun as Mars.
The time of Mars’s perigee is an especially good time to observe it, since it neighbors the Earth in the solar system and has the greatest variation of all of the planets in its distance from the Earth. This in turn leads to a large variation in its apparent size and brightness.