As with most pieces of literature, knowing something about the context of Franz Kafka's The Metamorphosis helps us better understand the piece on a literal level and also the deeper meanings beneath the surface.
Let's begin with the context of Kafka's own life. The Metamorphosis was written in 1912 when Kafka's health was already failing significantly. He had considered suicide by this point, and he was feeling significant pressure from family members to contribute to various ventures (like an asbestos factory). Kafka was not especially excited about any of his jobs at this point, either. He worked as a lawyer, but he didn't like it. It was merely a way to fund his writing. Further, Kafka had always had a rather antagonistic relationship with his father, whom he viewed as a domineering man and even a tyrant.
We can see, then, several parallels with the story already, as Gregor is not especially excited by his job and then cannot perform it at all when he turns into a giant insect (a possible allusion to Kafka's own illness and discontent). Gregor also has significant difficulties with his father, who attacks him more than once and ends up indirectly killing him.
Kafka's tale is also influenced by the ideas of the day, including nihilism, psychoanalysis, and modernism. Nihilism rejects meaning and even reality. Gregor's life is mostly meaningless to him, for he hates his job and has little to live for, except his desire to see his sister succeed. When he becomes an insect, the rest of the meaning of his life is removed, and he is left with nothing.
Psychoanalysis enters the story with the reference to Gregor's dream and his significant anxiety. There is more than a hint here toward the theme of dehumanization as well, and Gregor's feelings that he is less than human are made real in his transformation. Finally, modernism influences the story in its mix of realism and the fantastic, its symbolism, and its assertion of absurdity.