Firmware is a special class of software that is responsible for controlling hardware. It is not stored in hard drives or SSDs like regular software, it’s etched into the device itself (found on memory chips on the device) when it gets manufactured.

BIOS and UEFI are examples of firmware.