Today we know Andersen as a writer of children's stories, but he actually saw himself as a genius and a serious artist… the kids' stuff was only one of many projects he had going on in his Great Quest for Fame. (Source.)
Andersen's affinity for the theater came about because he was born in Odense, the only town in Denmark outside the capital that had a theater. (Source.)
Andersen never married, though it's believed (based on his diaries and letters) that he had crushes on both men and women in his life. Since it wasn't acceptable to be gay or bisexual back in 19th-century Denmark, maybe Andersen's love life helps to explain why he was so unhappy? (Source.)
Another source speculates that Andersen was asexual and saw himself as spiritually androgynous, which could account for his attraction to both men and women as well as his unwillingness to act on those feelings. Though he apparently visited a few brothels in his lifetime.
Although Andersen and Charles Dickens had a lot in common in the writing world—both were pretty darn prolific and wrote about social ills such as poverty—they met and apparently didn't get along that well. At least from Dickens' perspective, since he found Andersen to be a total bore. (Source.)