What is a deed in lieu of foreclosure, and how does it work?

What is a deed in lieu of foreclosure, and how does it work?