I imagine it's probably just that the barley has been roasted darker, and that comes out.
If you follow the information trail through Wikipedia's page about Stout beer, you find that what was known as Stout became a strong, dark beer in the 1800s:
In the 19th century, the beer gained its customary black colour through the use of black patent malt, and became stronger in flavour.
You can see from the article about mash ingredients that black patent malt is "barley malt that has been kilned to the point of carbonizing, around 200 °C." It is apparently called "patent" malt because the inventor was awarded a patent for it.
Sometimes, this malt is used to darken the colour of other beers.
You're right - is the high kilning temperatures used in the malt that give it a dark color.
Note that not all Stouts use black patent malt - some use roasted unmalted barley, most famously, Guinness, which uses 18% roasted barley in the recipe (IIRC from my trip to the brewery.) If you look through a pint of Guinness, you'll see that it's not simply jet black, but in fact fairly clear, and the light will give ruby highlights to the beer.