It is difficult to think of DC Comics. It is safe to say that without Gotham, there is no Batman. His entire existence as a character, both as Bruce Wayne and the Caped Crusader, is built around helping his city. There is a considerable amount of lore surrounding Gotham itself that makes it equally as important as the Dark Knight himself.
The impact that Gotham has on Batman in his comics forces it beyond just the scope of the stories' setting, making it a character more than a place of crime. In Gotham City has its own share of the good and the bad, and the struggle between these two forces foregrounds many Batman stories.
Gotham City is a character of contradictions, just like Batman. It is simultaneously a birthplace for villainy just as much as it is a birthplace for heroism. This sets up its central struggle as a character over what its core identity is: is it really a good city bogged down by a few bad apples, or is it a bad place in desperate need of redemption? The tension between good and evil that characterizes Gotham City's tumultuous reputation adds a powerful human dimension to Batman comics. Though Gotham is not literally a person like Batman and Bruce Wayne, it is ultimately composed of fallible humans, whose moral alignments color the city's everyday life. The dramatic coexistence of good and evil in Gotham City thus makes it one of the most realistic characters in DC Comics.
For Batman and Bruce Wayne, Gotham provides an opportunity for both self-redemption and corruption, forming the foundational layer of his identity as a superhero. Indeed, his origin story begins in Gotham with the murder of his parents, Thomas and Martha Wayne, and the corruption that continues in his adult life awakens him to the need of a figure like Batman. As such, this dynamic in Gotham illustrates its contradictory nature: its superheroes are a symptom of its violent reality.
Batman stories set in Gotham City are thus stories where the true nature of the city becomes a moral battleground. It is just as capable of its own self-destruction as it is with saving itself, a frustratingly human reality that Batman is forced to come to with. In this sense, Gotham being a foil to Metropolis ushers in a more nuanced look at human nature, explaining part of why Batman is such a longstanding character. Humanity has always been plagued by its own capacity for both destruction and growth, making Batman and Bruce Wayne's crusade to help his city one that is essentially timeless. For as long as there are men to be corrupted and men to be saved, the story of Batman and Gotham City lives on.