Layout 'attach' and 'attachHTML' Question

In this snippet, DHX demonstrates how to alternate between attaching a component and attaching HTML to the SAME LAYOUT CELL. My question is what happens to the previously attached component when an ‘attachHTML’ is evoked? Does it ‘detach’ or does it remain in memory? I alternated between attaching the component and attaching HTML about 10 times just to see if I could determine the answer but it didn’t become apparent (at least to me).

I ask because v8 offers a Layout ‘detach’ method but prior to that there was no way to detach a component. I have v7 and I would like to better understand what happens when a ‘second’ component is attached to the SAME LAYOUT CELL. Does it overwrite the previous attach or is it left?

After you attaching a new content to the layout’s cell the previous component stays in the memory and you need to destruct it (destructor() method) or you can attach it to some other layout cell.
If you are attaching the html to the layout cell this html will stay in DOM of the page only, so replacing this html with another content will clear that html from the page.

Thank you! This is the information I needed to know. Much appreciated.