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

I guess there is a setting in there, which I’ve checked, to not let my MBP sleep when the screen goes dark. I must have figured there are network things in the background that are important to keep going.

If I let it sleep, will the same thing happens that happens when I close the lid: all the windows will revert to my main display?

Does closing the lid force it to go to sleep?

Is there a way of opening the lid and having the windows go back to the displays they were at?