Any particular reason Korsh et al decided for Harvey to have this storyline involving panic attacks, psychiatry, mental health, etc?
Korsh explained in an interview with Entertainment Weekly
EW: How did you come up with the therapist story line for Harvey?
Aaron Korsh: I did not come up with it, so at first, I couldn't wrap my head around it. What's gonna get that guy in therapy? Once we talked about it, he was having a difficult time with Donna leaving and that's the only thing that made sense. A guy like him is only gonna go to therapy if he feels like he has no other choice. We wanted to create a situation like that and to tell the story of being in therapy is a difficult thing to do. We're not The Sopranos. We're not gonna stay in there for 45 minutes, not that they always did.
The idea was to have it as a framing device where he's telling a story and he's in therapy for much of the episode and you go back to six weeks earlier. We play with time and we decided to catch up in time and finish the episode out from there. It was tough to figure out.
AK: Harvey has some deep-seeded issues we've touched on with his mom, some abandonment issues. We've seen that in the past when Donna has said, "Nobody is leaving." Things like that don't ever really get resolved in a short period of time. There are fits and starts. Two steps forward, one step back. We've taken that approach to this.