This map shows the pre-1965 County of London in white; the green bit on the top left hand side is the area run by the former Middlesex County Council (and the red line marks the boundaries of modern Great London). Originally London itself was in Middlesex, which followed the eastern boundary of the (white) County of London down to where it meets the Thames. The London County area was created because as London grew it no longer made sense to have part of the built up area run by a separate authority; again, by the middle of the 20th century, there was no clear reason why Hammersmith should be in London, whereas the same streets continuing to the west in Chiswick should be in Middlesex. The argument for retaining the name Middlesex is that it expresses something: the idea of London as a collection of villages; a celebration of its rural past; the retention of a sense of place; a conviction that a high street, park or parade of shops in North West London is still significantly different from somewhere similar in South London or urban Essex or Kent. For one thing, Londoners colonised the surrounding countryside following routes out of town they were familiar with from weekend and bank holiday excursions: so the human geography of Middlesex is different from Surrey or the other counties that border London.
You can see that nearly all of Middlesex is inside the boundaries of the Greater London area apart from two sections: the green bit to the south west which was given to Surrey in 1965 and is now run by Spelthorne district council and the section under the D of ‘Hertford’ which went into Hertfordshire and is now run by Hertsmere District Council