Our current postcodes have their origins in the Victorian era
London was getting so big and there were quite a few common street names to confuse the unwary, so London was split up into 8 wedges each with a letter corresponding to a point of the compass and going out about 12 miles, so including places like Croydon, Kingston and Romford. What was then regarded as the central area was categorised East Central (EC) or West Central (WC).
The NE and S Division were abolished following a report by Antony Trollope. NE got merged into E in 1866 and S got split between SE and SW in 1868 , so that is how we have the basic letters forming the first part of our London postcodes.
Then these areas were getting too large and so numbers were added just around the time of the First World War, which explains if you see original street signs from before this period, they only have the letters and not the numbers. One place you do still find a lot of Edwardian street name plates is in Wandsworth, where they just say SW. At this point or possibly a bit earlier the London district was made a bit smaller to the broadly the area we have today.
Later when the Post Office created the Postcodes we know and love today, they built on the letters and numbers of the London system to form the base of the post code of today. In a few high density areas it was necessary to split the post code district. Initially this was only done in EC, WC, SW1, and W1 where the whole district was sub divided. More recently bits of E1 and N1 have been subdivided, so there is E1W, N1C and N1P but the rest of E1 and N1 are not subdivided. A very British way of resolving a problem!
The post code area bear no resemblance to any administrative boundaries and in fact there is one little bit of the London postal district which is outside the administrative area of Greater London – that is part of E4 which covers Stewardstone in Essex – part of Epping Forest district.