For microcontrollers, it's a bit different. Firmware often represents the entire software stack, due to limited memory and compute resources. Low-power sensors are more heavily customized for specific markets, so changing firmware is essential to building a proper solution. Small devices like freight tracking sensors don't communicate directly with the cloud, and need to work as a mesh network to...
Since its introduction in 2005, the Unified Extensible Firmware Interface (UEFI) has become the primary standard for firmware development.
Attacks operating at the firmware level can be difficult to discover. There are methods for detecting and defending against attacks, which Intel shares through open source and training.