It is very slow and painful for the Yeerk. If this happens while the Yeerk is inside a host, they lose control of their minds and all of their memories are opened up to their host, including memories Yeerk had acquired from previous hostbodies. Some (like Jake) even get a momentary glimpse into another higher dimension, and see Crayak. The Yeerk then falls out of its host's head, shrivels up and dies.
<Yes,> the Yeerk said, having read my thoughts. <Dawn. Just a few hours left. Ahhhh!> He cried out in silent pain. <The fugue. It begins.>
<The final hours. You will not enjoy it, although you may learn a great deal, human. You may learn more than you want to - aaaahhh!>
I was watching his pain from far away. I was an observer. Close enough to know what he was feeling, but feeling none of it myself. At first it was wave after wave of pain. Starvation and death by thirst. All rolled into one agony.
The sun came up. Cassie stepped into the shack from the woods outside. She looked at me and nodded. "It's happening, isn't it?"
-page 81-82, The Capture