While not strictly related to the books, I must mention that when I went to England one of my destinations was Oxford. While in Oxford I went and had a beer at Tolkien's pub, visited Tolkien's house (20 Northmoor Avenue, there is a plaque on the house that identifies it as such) and paid a visit to his gravestone. Tolkien was a professor of English literature at Oxford and it shows in his writings. As mentioned previously, he borrowed as lot of ideas from the many books that he had read and incorporated it seamlessly into his epic.
It is said that Tolkien hated Shakespeare and considered his writings unoriginal and contrived. One thing he points out in Macbeth is where Macbeth is told that he cannot be killed by one of woman born. This meant that it was only McDuff, who was born by caesarean section, who could kill him. This, Tolkien thought, was rubbish, and wrote into The Lord of the Rings a concept that he thought was much better, that is that the Witchking of Agmar could not be killed by the hand of man and it was Eowyn, the daughter of Theodren, that ends up slaying him. Personally I think this is just as contrived, but Tolkien's dispute with Shakespeare can be left for another day.
As with the opening of the Two Towers where we are introduced to Theodren, a king driven mad by the power of Saruman, in Return of the King we are introduced to another mad ruler, the Steward of Gondor. Gondor does not have a king, and has not had a king for a very long time. Instead the land is ruled by the Stewards, but there is an anticipation that a king will return and take the throne and this is something that the Steward does not want happening. He has become corrupted by power and the only way that he is able to let go is through death.
In Lord of the Rings power corrupts, and corruption leads to madness. We see this clearly with Gollum. He finds the ring and upon finding it he is immediately entrapped by its power. Bilbo has pity on Gollum, and in the end so do we. His life is corrupted by one desire and that is to possess 'his precious' - the one ring. The ring dominates his entire life and he ends up hiding in a dark cave staring at his precious. However when he loses it his life is destroyed. It is at this point that even we, the reader, pity him because we know that his life has no meaning beyond possession of the ring. This drives him to then search for the ring, and this greed that has corrupted his heart pretty much makes him untrustworthy. The only reason he helps Frodo is to attempt to get back his precious.
There is a point where Gollum appears to have beaten his demon, and truly understands Frodo as a friend, but this changes when Frodo is forced to betray Gollum. What Gollum does not realise, and never realises, is that Frodo did this to save his life. However Gollum is an individual that is driven by one obsession and it is this obsession that drives him to separate Sam from Frodo. He knows that the only thing standing between him and his precious is Sam, and he does what he can to get rid of Sam. However, as mentioned previously, it is Sam's undying loyalty to Frodo that drives him, and even when Frodo sends him away Sam always remains there, ready to step up and save his friend.