Recovery is an independent, lightweight runtime environment that’s included on a separate part from the main Android OS on all Android devices. You can boot directly into recovery mode and use it to factory reset the device, delete the cache or apply for software updates. It can help you to fix your device.
The stock recovery is pretty limited by design. Its main purpose is to delete all, or some, user data and files, as well as performing system updates manually with signed and verified delta update packages. Usually, both of these operations are started from the running Android system but you can do things manually and boot right into recovery by yourself. When you tell your phone to do a factory reset, recovery is what boots up and erases the files and data. Likewise with updates— when we restart to install an official OS update, it's done in recovery. Recovery is also where we go to manually install official OS updates that we've downloaded from the Internet. It's very useful but it's limited. Different manufacturers use different recovery methods but all of them perform the same basic functions — provide the tools needed to recover a working system.
Custom Android recoveries offer much more. They have been coded to allow backup and restore functions, select deletion of data, so you don't have to wipe everything, and modified to allow update packages that have not been digitally signed by official sources. You can also mount various parts so you can copy files to the SD card without having to remove it or reboot into Android. Because of the extra functionality built in, they are a pretty important tool for folks who want to hack their Android phones or tablets.