question about maintainence message

When I'm doing my plugin/them updates i often get the following message:
Briefly unavailable for scheduled maintenance. Check back in a minute.

What is going on behind the scenes when you normally get this and sometimes it takes up to five minutes before I can get back into the site?