What happens when you close your MacBook Pro lid? Various questions

Hi, people. I don’t know why this supposedly simple thing is so endlessly confusing to me. I even spent time talking with Apple Support yesterday and they told me flat out when the lid is closed it goes to sleep.

Yet I have an external display attached. And I also have a bluetooth mouse connected.

But if I close my lid all (or sometimes just most) of my windows return to the main display and I have to replace them when I open the lid again. I think I’m going to use Display Maid to handle that problem going forward. It is much much much easier to use than Moom, which somebody here recommended, and also much less expensive.

These are my settings. I don’t see “clamshell” mentioned anywhere. And this appears to be the only setting where the Mac going to “sleep” is mentioned at all, except for the schedule settings, which I’m not using.