I would imagine the spider is a metaphor of the building depression the main character is experiencing throughout the ordeal (the more isolated the MC made themselves and depressed they felt, the bigger the spider became up to a breaking point).
The spider having disappeared becoming the point where the MC turns their life around and accepts help from their friends who were there from the beginning of their downward spiral (Worst case scenario for most people that feel so isolated that they have no one to turn to would be to just speedrun their life and be done with it).