Hardware RAID controllers have a specialized CPU for parity calculations & interface microcode, have dedicated cache memory and a battery backup to keep the most recent writes in case of a power failure. Think of it as a specialized computer which does nothing but handle disk management and I/O. Each manufacturer has its own BIOS & firmware, and performance differs greatly. Most have SFF-8087 connectors which can either break into four SATA/SAS channels each or link directly with an internal enclosure, although some cheaper models have individual SATA connectors. (Example: an Areca 1680ix-24-4G can manage 24 SAS/SATA drives, 4GB of dedicated memory and a dual-core Intel CPU specialized for SAS I/O.)
The first really successful RAID controllers were probably the SCSI Adaptec 2940-series.
There is probably a huge markup for the cost of hardware RAID controllers.
Daimon