Carrie was not doing well in the aftermath of last week's disaster, when Saul was kidnapped and Aayan was killed by the not-dead terrorist, Haqqani. She's feeling guilty for all of that and for getting Brody killed, too. And it definitely did not help that her Bipolar meds had been switched by the ambassador's super shady husband.
So, Carrie ended up going a little crazy, hallucinating things and people, and waving her gun everywhere until she was taken away by police. She was kept in a cell for a bit before being let out into a strange house, where she ran into…Brody?!