It is common for humans to imitate those around them. Aristoteles said that learning begins by imitating another person, usually your master, professor, or parents.
Also, listening might be a powerful personality changer. The psychologist Jordan Peterson said that listening truly and sincerely what another person has to say almost always changes the listener, sometimes radically.
Elaine exercises the profession whose job is to listen. Therefore, listening to her patient made her imitate, as Aristoteles said, and change her behavior towards this patient. She did not act as her job demanded, but, as her patient influenced her while talking, the therapist acted more and more like another patient. As Jordan Peterson suggested, the listener became similar to the speaker, and the anxiety one had passed to the another.