Concept
The host bus adapter: the card, or the chipset function, that connects the disks (over SATA or SAS) to the CPU (over PCIe). It passes each disk through unchanged, so the operating system sees every one of them. A plain HBA computes no RAID; some run a firmware with the simple levels, never parity. A RAID controller is built on one chip that is both the disk controller and a RAID engine.
Disks connect over SATA or SAS; the CPU reaches the cards plugged into the motherboard over PCIe. Something on the path has to connect the two, and that is the Host Bus Adapter (HBA). It is a chip, on a card plugged into the motherboard or built into the motherboard itself, and its job is to pass each read or write arriving from the CPU over PCIe on to the right disk, and the disk's answer back.
SAS carries SCSI commands. Every command has a sender and a receiver: SCSI calls the sender the initiator and the receiver the target. The HBA is the initiator, and each disk is a target. When there is a backplane, the commands pass through it on their way to the disks.
An HBA does not change what the operating system sees: every physical disk appears as itself. Any RAID is then done by something else: the operating system, or a firmware working with the operating system's driver (raid engine).
On a desktop PC the HBA is usually not a separate card: it is built into the motherboard. It is the SATA controller of the chipset, the chips on the motherboard that connect the CPU to the disks and to the other devices. Intel's AHCI specification, the standard those controllers follow, says so: "A host bus adapter refers to the silicon that implements the AHCI specification to communicate between system memory and Serial ATA devices."
On a server the HBA is usually a PCIe card, and each of its connectors carries several lanes. The LSI SAS 9300-8i has "two x4 internal mini-SAS HD connectors (SFF-8643)", four lanes each; the Broadcom 9500-16i has "Two x8 SFF-8654", eight lanes each.
Some HBAs do compute RAID, within a limit, when they are given a different firmware. The LSI SAS 9300-8i can be reflashed "to run Integrated RAID (IR) firmware", which supports "RAID 0, RAID 1, RAID 10, and RAID 1E". These are the levels without parity: they place and copy blocks but compute nothing from them. Parity needs a chip built for it.
The difference between an HBA and a RAID controller is the same as the difference between software and hardware RAID. An HBA only connects the disks: the operating system sees each of them and runs the RAID itself. A RAID controller connects the disks and also runs the RAID: it builds the array and hands the operating system a virtual drive instead of the disks.
On a RAID controller card both jobs are done by a single chip, the RAID-on-Chip (RoC). It is not an HBA chip with a RAID chip added beside it: one chip is the disk controller and the RAID engine at once. An HBA card uses a simpler chip, which only connects the disks. Broadcom, which makes both kinds of card, builds them on different chips, and the operating system even uses a different driver for each: in Linux, mpt3sas for HBAs and megaraid_sas for RAID controllers.
Some RAID controller cards can also work as a plain HBA. The controller maker Microchip calls this the card's HBA mode: the card turns off its RAID functions and shows every disk to the operating system as it is. In its mixed mode the card does both at once: some disks form RAID arrays, and the others are shown as they are. So whether a card acts as an HBA or as a RAID controller depends on how it is set to work, not only on the card itself.
An NVMe disk carries its own controller on the PCIe bus. Nothing has to translate between the disk and the CPU, so an NVMe disk can connect without an HBA. Tri-mode adapters can attach NVMe disks anyway, next to SAS and SATA ones in the same bays: Broadcom's "PCIe device bridge (PDB) enables the PCIe (NVMe) storage interface connections".