When one service needs to tell another service that something happened, the simplest approach is a direct call: service A calls service B over HTTP and waits for a reply. That breaks the moment B is slow, down, or swamped. A message broker fixes this by becoming a middleman. Service A hands its message to the broker and moves on. The broker holds the message and delivers it to service B when B is ready.
The sender is called the producer. The receiver is called the consumer. The broker stores messages in named structures, usually queues or topics, until a consumer picks them up. Because the producer and consumer never touch each other directly, you can restart, scale, or replace either side without the other noticing.
A broker is more than a dumb mailbox. It speaks messaging protocols like AMQP, MQTT, or STOMP so clients written in different languages can interoperate. It decides which consumer gets which message based on routing rules. And it offers delivery guarantees: it can persist messages to disk so they survive a crash, redeliver a message if a consumer fails to acknowledge it, and keep messages in order within a queue.