Deed in lieu

What is a deed in lieu?? And when would I need it?

Some banks will allow a homeowner to sign a deed to the bank for the property in lieu of the bank foreclosing on the property.