Message Queues Deadlock Prevention

I’m trying to understand the concept of message queues and how it work .

It appears that a message queue serves as a communication mechanism that enables the exchange of data or messages between different tasks or threads.

For example, suppose we have two tasks, where one sends data to other, and the other reads that data.

I’m particularly interested in understanding how message queues help prevent deadlock situations in such scenarios.

Which deadlock ?
Also do you know the comprehensive FreeRTOS docs like