A message queue has three parts: producers, the queue itself, and consumers.
Producers send messages to the queue. The queue stores them until consumed. Consumers pull messages and process them. If consumers are slow, messages accumulate. If consumers crash, messages wait.
This decoupling is powerful. Producers don't care who consumes messages. Consumers don't care who produces them. You can scale each independently.