An IoT gateway acts as the central hub that connects sensors, devices, and machines to cloud platforms. It collects, filters, and processes data at the edge, enabling secure communication, real-time insights, and efficient control of large IoT ecosystems.