It was written by McCartney, though credited to Lennon–McCartney. “Maxwell’s Silver Hammer” is a pop song with dark, eccentric lyrics about a man named Maxwell who commits murder with a hammer.
The song was written in October 1968, intended for the album The Beatles, but missed off due to time constraints. It was rehearsed again three months later, in January 1969, at Twickenham film studios during the Get Back sessions but would not be recorded for another six months.
Linda McCartney reports that Paul had become interested in avant-garde theatre and had immersed himself in the writings of Alfred Jarry. This influence is reflected in the story and tone of the song, and also explains how Paul came across Jarry’s word “pataphysical”, which occurs in the lyrics.
Beatles guitarist George Harrison described the song in 1969 as “one of those instant whistle-along tunes which some people hate, and other people really like. It’s a fun song, but it’s kind of a drag because Maxwell keeps on destroying everyone like his girlfriend then the school teacher, and then, finally, the judge.” Lennon described it as “more of Paul’s granny music”.
In 1994, McCartney said that the song merely epitomises the downfalls of life, being “my analogy for when something goes wrong out of the blue, as it so often does, as I was beginning to find out at that time in my life. I wanted something symbolic of that, so to me it was some fictitious character called Maxwell with a silver hammer. I don’t know why it was silver, it just sounded better than Maxwell’s hammer. It was needed for scanning. We still use that expression now when something unexpected happens.”
On 9 August 1967 Kenneth Halliwell killed his lover Joe Orton with nine hammer blows to the head, and then overdosed on sleeping pills. Their bodies were discovered late the following morning, when a chauffeur arrived at the door of their Noel Road flat in Islington to collect Orton for a meeting with The Beatles regarding a screenplay he had written for them. (source: Wikipedia)