In A Tale of Two Cities, Charles Dickens uses the flies as an extended metaphor in the courtroom scene in Chapter Nine to suggest that the way the spectators hovered around the trial is similar to flies that are attracted to a potential feast:
"a buzz arose in the court as if a cloud of great blue-flies were swarming about the prisoner, in anticipation of what he was soon to become" (Chapter 9).
First, flies are an annoyance, as is the buzz of the spectators as they excitedly discuss the possible outcome of the trial. Dickens' diction, his use of words like "buzz" and "swarm" indicates the narrator does not appreciate or condone the outside involvement of the crowd at the trial; rather he views them as pests.
He continues this metaphor of the crowd buzzing like flies throughout the key moments of the trial, almost as if the crowd is anticipating that some delightful morsel is about to be served; their fervor is both vicious and punitive. They want the prisoner to be found guilty, so they can, in their way of thinking, be treated to a gruesome execution.
Note: I referenced chapter 9 above because in my copy of the novel, the chapters from book to book continue numbering chronologically. But in the version of the text on eNotes, the same chapter would be Book II, Chapter Three.
Flies have traditionally been symbolic of death and evil. At the trial of Charles Darnay, the flies buzz because there is evil intent in that courtroom, and a death sentence for treason hangs over the innocent Charles Darnay.
As a social reformer whose father had been in debtor's prison, Charles Dickens was familiar with the slanted justice the influential were served and knew it was very different from the justice reserved for others. Also, as a foreigner, Darnay is suspected automatically. His "tremendous heresy about George Washington" implicates him because the French have sided with the Americans in the revolution against Britain. The hungry crowd is "buzzing" in hopes of a new death, especially if it is a despised Frenchman.
But when Charles Darnay is acquitted thanks to the clever Sydney Carton, who creates doubt about Darnay's identity because of their close resemblance to one another, the blue-flies of evil disperse into the street "in search of other carrion."