Your question is about HW raid recovery, so you look at the features that the HW raid card / controller provides for you.
- a BIOS, which you can get into before the OS boots. Configuration can be done here.
- A processor or other "accellerator" that takes the work of managing the raid, and deciding where read/writes are directed.
- A scheme for identifying which physical disk belongs to what part of the RAID.
- A way to inform you about the status of the RAID.
Your RAID card will come with drivers and software that is supported under your OS that allows you to do configuration and status management without having to reboot into that BIOS.
For server hardware, the drives themselves are on hot-swap sleds with additional LEDs. These provide the physical feedback to you if the controller detects a problem with the RAID.
For desktop computers, your drives are hardwired to the RAID card or motherboard.
The driver and the software in your OS may also detect this and alert you some other way (email, etc).
Once a drive has gone bad, the controller stops reading and writing to it, relying on the remaining drives to serve the data.
This is called a degraded state, you are still working, but one more failure pushes you over the edge into data loss. (2 more failures if you're running RAID 6)
For a hot-swapable raid controller, you simply pull out the failed drive, and put in a blank one.
How does it know it is blank? That's the job of the (3) scheme.
All drives have unused data at the beginning, the partition table has plenty of free space in it. Each manufacturer will use it differently, but this is where the raid controller will store data that tells it which drive belongs to which part of the raid.
Once it sees a new drive that has not been used by this raid card before, it can start the restore process.
This can be automatic or triggered by the user, and can of course completely obliterate the new drive's contents if it was already formatted for something else.
The recovery or rebuild is managed in the background by the raid controller, it reads each sector from the remaining drives and calculates what should be on each sector for the new drive.
For RAID 1, it simply copies accross all sectors of the existing good drive to the new drive.
For RAID 5 or 6, all the existing drives are read, and the data to write to the new drive can be calculated.
Since this work accesses the remaining drives, you can usually set a priority for it, so it doesn't slow down the whole system.
But you'd need to consider whether speed to recover back to full RAID status is more important than ongoing work.
Some controllers, e.g. ones built into a regular desktop motherboard, might require you to go into the BIOS and trigger the rebuild there, and not let you boot into the OS until it's ready again. That would be an inconvenience, and would not be a good HW Raid because you want uptime as well as reslilience to failure.
A standalone HW raid card will give you the convenience of a rebuild that doesn't affect your ability to continue working.
If the failure is in the RAID card itself:
The computer/server will most likely have crashed hard and is not bootable.
At this point you might assume that the drives themselves are still viable, but it is more likely that the drives are in an inconsitent state, i.e. writes to one drive were not fully propagated to other drives.
You are at the mercy of the Operating System and its File System error recovery for this.
Worst case here is that you need to recover data from a backup as well after repairing the computer/server.
If the RAID card is replaceable, an identical model can be installed in its place. Because the individual drives still report the same Identification in a manner that the RAID card recognizes, the full set of drives will work as before without complete loss of data (though File System inconsistencies may be present).
If the RAID controller was part of a motherboard, the whole motherboard must be replaced with one with the same model RAID controller.
If you attempt to use a different brand of RAID controller, most likely it won't recognize the drives at all, and just ask you how you want them newly configured, which will erase all existing data.
In HP Servers, all the various models of built in and plug-in RAID controllers share the same scheme for disk identification, so replacement of a built in controller with a plug-in, or a plug-in with a more powerful plug-in model is possible without loss of data.
In either case, care must also be taken that the replacement RAID card has its firmware updated to the same or newer version than the one being replaced.
Again with HP servers, I have had a server die, then I pull the whole set of drives in a RAID, and plug them into empty slots in a new server (already powered on), and the data is visible straight away.