A Raspberry Pi can do a lot, but adding an ESP32 gives it the physical reach that small hardware projects often need.
More often than not, an IoT master device uses the SPI (serial peripheral interface) and I 2 C (inter-integrated circuit) protocols to exchange data with EEPROMs or sensors that are operating in slave ...
The Pi Zero 2 W is tiny and low-power, but it is also incredibly versatile.