What an interesting question! Most contemporary writing about the fog focused on its affects and not its cause. The literature is replete with references to "pea soup" or the yellow hue of the fog or the dangers of becoming lost in it. I do, however, have a few contemporary quotes which speculate on the source of the fog.
Peter Cunningham in his "Hand-Book of London" (1850) attributed the fog to stagnant pools, undrained marshes, open ditches and "the lamentably defective drainage of the neighbouring lands." He suggested that if these were drained the fogs would vanish.
John Timbs in "Curiosities of London" (1867) correctly realized that coal fires contributed to the fogs saying, "This phenomenon is caused by the millions of blazing coal-fires in the metropolis vast quantity of fuliginous matter, which, mingling with the vapour, partly arising from imperfect drainage, produces that foggy darkness which Londoners not inaptly term 'awful.'" He also states that, " Sometimes the Fog is caused by a very ordinary accident,-a change of wind, thus accounted for: the west wind carries the smoke of the town eastward in a long train, extending twenty or thirty miles, as may be seen on a clear day from an eminence five or six miles from the town,-say, from Harrow-on-the-Hill. In this case, suppose the wind to change suddenly to the east, the great body of smoke will be brought back in an accumulated mass; and as this repasses the town, augmented by the clouds of smoke from every fire therein, it causes the murky darkness." He recognized that changes in the direction of the wind directly contributed to the density of the fog.
But even as late as 1879, improperly irrigated land outside of the city was still blamed as the source of the fog (although, it's now blamed in combination with soot from chimneys). In "Dickens' Dictionary of London", Charles Dickens Jr. writes, " As the east wind brings up the exhalations of the Essex and Kentish marshes, and as the damp-laden winter air prevents the dispersion of the partly consumed carbon from hundreds of thousands of chimneys, the strangest atmospheric compound known to science fills the valley of the Thames." Interestingly, in a circa 1908 edition of the book, this sentence is omitted from the passage about the fog and instead Dickens writes, "Whether Smoke Abatement Acts have done something to make things better or the peculiar atmospheric combination, have failed to amalgamate as they certainly used to, whilst London gets fogs (as nearly any place with a river near the sea would naturally do), of recent years they have not been so thick and dense and orange-coloured as they once were, there is more pure fog in them, less smoke, and they are whiter than they used to be." The Smoke Abatement Act he is referring to was included in the 1875 Public Health Act. There were more provisions about smoke abatement/pollution as part of the 1906 The Alkali, etc. Works Regulation Act. I do not know if the 1906 act would have been effective enough for Dickens to notice a difference by his 1908 edition of the book.
Third time's a charm. There is more to the story than 'we figured it out in the late 19th C.' Some contemporary Victorian Londoners were certainly aware of the connection between industrial pollution (and residential burning of coal) and the "London Fog." Here is some sourced information indicating that the problem had been thought about (and rightly parsed) as early as the 13th C., with a Royal Society member publishing a treatise on the subject ("FUMIFUNGIUM: or the Inconvenience of the Aer and Smoake of London Dissipated") in the 1660s.
From an EPA Journal article on the subject:
In 1661, John Evelyn, a noted diarist of the day, wrote his anticoal treatise FUMIFUNGIUM: or the Inconvenience of the Aer and Smoake of London Dissipated, in which he pleaded with the King and Parliament to do something about the burning of coal in London. "And what is all this, but that Hellish and dismall Cloud of SEACOALE?" he wrote, "so universally mixed with the otherwise wholesome and excellent Aer, that her Inhabitants breathe nothing but an impure and thick Mist accompanied with a fuliginous and filthy vapour..."
There was certainly some knowledge of the dangers of burning coal going back more than 600 years before modern regulations dating to 1906 (Alkali act).
Here is a good primary peer-reviewed source on this question from 1995. The author, Jenner, argues in The Historical Journal paper titled "THE POLITICS OF LONDON AIR JOHN EVELYN'S FUMIFUGIUM AND THE RESTORATION" that Evelyn's 17th C work on coal and air pollution was motivated by political concern and a scientific interest in the composition of air (Evelyn was a Royal Society member). Regardless, it is clear that some people were certainly aware of the connection between burning coal and the smog often referred to as "The London Fog" and in certain circumstances as "The Smoke."
By the time the brand "London Fog" had come out was the fog in London relatively clean? I always thought of that as a romantic fog rather than a mucky, pollution filled one.
I've read several housekeeping manuals from the Victorian and Edwardian eras, and it was necessary to devote a huge amount of effort in fighting back the filth. Clothes, furnishings, and human bodies were constantly having dirt and coal dust deposited on them, and trying to keep them clean was a constant battle. They knew the source of the dirty air and dust wasn't a natural phenomena such as 'fog'. And it was only the upper and middle classes who had the resources to even try to keep their environment somewhat clean. As for the poor who lived crowded together in filth, they died at huge rates from chronic respiratory diseases, along with communicable diseases, malnutrition, and scores of other things.
The book you need for this is Peter Thorsheim's Inventing Pollution. It's an excellent book, one of the best environmental histories of Britain, and it answers exactly this question. Another book, somewhat older, is Peter Brimblecombe's The Big Smoke (or something like that). Thorsheim's book is the one you want, though.