First, I should say, as for my notes on IPA and APA, that they are my conclusions from over 30 years of reading beer and brewing history. (I even tasted a little of the stuff, from all over). Some of the historians, antiquarians and consumer and technical writers I've read are Michael Jackson, Gourvish & Wilson, Peter Clark, Ian Hornsey, Roger Protz, Martyn Cornell, Ronald Pattinson, and there are many, many others including numerous 19th and 18th century brewing authors. I've done my own reading in source materials as well via the Internet and especially, Google Books.
Porter. Porter began in London in the early 1700's. In a story oft' repeated, it was said to be one brewing meant to combine the attributes of two or three beers commonly drunk and mixed at the bar. The components were ale and beer, or ale, beer and twopenny. The types of beers and mixtures vary in some of the accounts, but it appears that mild ale (sweetish and low-hopped), beer (well-hopped), and old beer which was sourish or lactic and sometimes strong, were blended to get a balanced palate.
It may be too that the mixtures were done, or done originally, to mix weaker and stronger beer as a way to minimize taxes. In the Queen Anne era, beer was taxed at two rates, depending whether it was strong or weak (in turn determined by selling price: if sold for 16 shillings per barrel it was strong; if sold for less, it was not strong). It can be seen that mixing weaker and extra-strong beer, to sell as strong, was a way to reduce the tax payable. These mixtures were known as "threads", and a common type, three threads, was said to be the predecessor of porter. Some think that "thread" was a corruption of third, but I believe the different thread beers - two threads, three threads, and up to six - was a way simply to differentiate by strength. Possibly what was a tax dodge turned into a practice liked for its effect: the balancing of different palates and/or strengths. Whatever the reason, the mixing of beers at the bar would have been a hassle, apart from the fact that, mixing was illegal under the statutes at the time, at least, above a certain quantity.
The story went that Harwood, an East London brewer, decided to make one beer, called entire butt because it was served from one large container or "butt", which would have the attributes of the mixes.
There was a Harwood, he did sell porter, but it is not clear if he was the first to do so or use the term. The first recorded use of the term porter is in a letter written by a college student in 1721. Porters - those who carried goods for an occupation - were known as fervent consumers of beer, and porter's ale and porter's guzzle and similar terms were used to describe what they liked. Finally the term was shortened to porter. Entire butt, or entire, was more the brewers' term.
Entire butt was an aged drink. Aged anywhere from 6-12 months or more. The aging would result in a dryish drink due to fermentable sugars being slowly consumed over time. Numerous 1800's writers state that porter should not be sweet. However, porter could be and always was in part drunk young - mild porter in other words. This was malty and sweetish but with the hopping characteristic of beer. Oddly, or not, mild porter and aged ("stale") porter were still mixed after porter became a noted drink. It seems that to avoid the expense of long aging to get exactly the right palate, brewers, starting around 1800, blended young porter and a little old, often sour porter, to get the palate formerly obtained by aging porter a year or more.
One of the amusing things, I could post examples, is reading as early as 50 years or so after porter's invention, say in 1770 or so, that porter isn't what it used to be. As early as then they were saying that and you read regularly the same complaint for the next few generations after. Nothing is as good as it was, even in the old days!
An important point is, porter and most of the beers it derived from or is an improvement of, were "beer", not (mild) ale. That is, they were well-hopped and therefore capable of long aging. Also, they were made from dark malts. Dark malt was a characteristic of porter, it is what set it off from mild ale and pale ale which were yellow, golden or a not-dark amber. 1700's porter was dark brown but by the 1800's became black. In the 1700's, the malt used to make porter was brown because it was kilned brown over a fire. When you color malt to that degree with heat, it consumes part of the starch, which means, less yield and less or no enzyme to convert the latter to fermentable sugar. In the late 1700's, brewers, in part due to increased taxation, decided to switch the base malt of their beer to pale malt. They added a little brown or amber malt (often both) to lend the necessary color. Later, they added malt roasted black, only a little was needed due to its intense darkness and taste, and finally roasted barley (non-malted) because it was cheaper. E.g. today Guinness uses pale malt, roasted barley (not roasted malt) and I believe some flaked barley (raw).
Because brown and amber malt had sometimes a smoky taste from being kilned on wood fires, porter always had a burned taste to a certain degree. The modern (since early 1800's) use of black malt and roasted barley to emulate the effect of brown and amber malt also gives a roasted flavour.
Stout was the same as porter, except stronger and usually long or longer-aged. Imperial stout was the strongest type, the luxury version, exported to Russia and other places that could pay the price. Milk stout was invented in the early 1900's by adding lactose, or milk sugar, to a porter or stout. Stout was originally called brown stout, meaning, a porter that was strong. In the 1800's, porter was around 5% ABV and stout 7.5% except for the stronger Imperial and similar types (extra double stout, etc.). These latter could reach 10% ABV and more. What is called Guinness Stout today was called Guinness Porter before 1900. In other words, because gravities generally have fallen since the 1800's, stout today often describes a beer that would have been a porter then. However the terminology always varied to a degree and for me porter and stout are interchangeable, they mean the same style of beer and only the strength is important to differentiate them. Oatmeal stout seems an early 1900's variation where some oatmeal (generally very little) was added to the mash bill, some feel it adds a silky or oily note.
Imperial stout was so-called because the Imperial Russian Court was a favoured customer. Catherine The Great is said to have enjoyed the beer.
Porter and stout are pre-eminently English drinks and specifically London drinks. Porter died out in London in the 1950's, but has been revived by craft brewers. Guinness was set up by an Anglo-Irishman who wanted to emulate London Porter.
Porter came to America with the English. Before lager took over here as everywhere, porter, along with pale and mild ales, were staples of breweries working in an English tradition. Washington enjoyed porter as did many Colonial and early American figures. Philadelphia was noted for the quality of its porter.
Modern American porter and stout sometimes are very similar to classic English stout in their hopping. English porter used non-aromatic hop types. Bitterness was essential, but the malt had the main say in the taste. Flowery hop was reserved for pale ale. Some American stouts though today use Cascade and other aromatic and piney-tasting hops. The results can be very good, and it's all a question of taste.
Black IPA links this thread to the other: it's an APA with a dash of porter flavour. Many breweries make one today, I (natch) make my own by combining a stout and an APA, e.g. recently I combined Dempsey pale ale and Stone Imperial Stout about 2:1 and it was great.