As in Eliot's The Waste Land, the modern city in “The Love Song of J. Alfred Prufrock” is a surreal place. The title character is isolated from the city in which he lives and from which he feels completely estranged. This makes it seem somewhat less than real to him, a feeling heightened by the pall of yellow fog that hangs over everyone and everything.
On a literal level, the industrialized cities in which Eliot spent much of his early adulthood, were quite polluted in the late nineteenth and early twentieth century, when he wrote the poem. The "yellow fog" and "yellow smoke" are animated representations of the smog that could be found in such industrial areas. While Prufrock may be literally describing the environmental conditions of a modern city, the yellow fog also functions on a symbolic level.
In a sense, the yellow fog symbolizes Prufrock himself. The fog is depicted as a kind of animal—perhaps a cat—slinking through the city solitarily, rubbing its "back" and "muzzle on the window-panes" and "linger[ing] upon the pools that stand in drains." Just as the feline fog lurks around the edges of the city, so too does Prufrock move about the city alone, feeling that he is not part of the social fabric.