Akbar built the Agra Fort as a fortified capital, with extensive gardens and palaces. He arranged the palaces in a band of courtyards along the riverfront at the edge of the Fort, with the imperial chambers overlooking the river, in a practice that dates back to the reign of Babur. When Shah Jahan, Akbar's grandson, rebuilt most of Agra's palaces, he preserved this aspect of the original plan. This orientation gave the imperial apartments pleasant river views and provided it with cooling breezes.
The row of palaces meets the axis of public access at the Diwan-i-Amm (the Hall of Public Audience), which starts at the Delhi Gate, through the Hathi Pol (Elephant Gate), and along the arcaded Bazaar street. A smaller, heavily fortified gate, the Amar Singh Gate, opens into the eastern edge of the palatial row.
Nath, R. 1995. History of Mughal Architecture, vol. II. New Delhi: Abhinav Publications, 102-135.