MQTT

What it is: A lightweight publish/subscribe protocol on top of TCP/IP, suitable even for low-power sensors. Clients connect to a broker, subscribe to topics and publish to them. The broker is the common interface through which everything exchanges data. Mosquitto docs HA docs In the smart home it's the bus between Zigbee2MQTT, network coordinators, Node-RED and Home Assistant.

How it works

According to Mosquitto docs:

QoS Delivery When
0 at most once, no confirmation frequent sensor values
1 at least once, with confirmation (may arrive twice) regular commands
2 exactly once, four-step handshake where duplicates hurt

The subscriber chooses the maximum QoS it will receive. Higher QoS is more reliable but slower. The "When" column is Synthesis.

MQTT in Home Assistant

According to HA docs:

Broker security (Mosquitto)

According to Mosquitto docs:

Gotchas

Implementation and integrations

Related

Sources