Midgar is the capital of the world Gaia on which Final Fantasy VII and all of the related canon takes place.
Midgar is controlled by the Shinra Corporation and is used to house their large Mako reactors which suck the energy out of the planet. As a result, the city was once very prosperous and people flocked to it for their chance of opportunity. However, due to the amount of Mako and the lack of limitations, the planet began to die because all of the energy was being taken out and vegetation and other natural processes ceased to exist except in a small church in which Aeris grew flowers. This is an anomaly however as the entire city is usually shrouded in darkness because there is a metal plate that covers the entirity of the sectors that is only 50 meters above the ground.
The large amount of people that live in the city are subject to extreme poverty as they live in the various slums in the eight sectors of which the city is seperated into. All of the slums are connected by the rail system and the underground tunnels which allow the Shinra Corporation to move the workers to the worksites efficiently and quickly. There is also an extremely complex security system implace that checks all of the Shinra Corporation's issued identification cards so that no one can travel anywhere in Midgar without the corporation knowing about it.
The entire city is around Sector 0 which consists of a 70 story building in which the Shinra Corporation headquarters are located. The position allows the corporations' private army to travel anywhere in the city quickly and to neutralize any security breach that occurs within the entire city. One of the biggest threats to the status quo is the group AVALANCHE which sees the Shinra Corporation as an evil entity and believes that the planet will eventually be killed. Led by the rebel Barrett, the group's primary mission is to destroy the Mako Reactors which are located in each of the sector's of the city.
Through the story of Final Fantasy VII the city of Midgar undergoes much change due to the actions of AVALANCHE and the resulting actions of the Shinra Corporation to stop the group from destroying their energy extracting capablities.