When we talk about queues we are really referring to a call queues. A queue can (but does not necessarily) correspond to a specific department in your organization. In such a case, when a caller chooses that department from the phone’s auto-attendant menu he will enter the queue of the department and literally wait on line behind other callers until an agent picks up the call.
Indeed a call queue's main function is to place incoming calls in a line to be answered once an agent become available to handle them. The queued calls are distributed to available agents in order determined by rules set in the ACD panel. The simplest and most obvious rule will just distribute a call to the next available agent. But there are more sophisticated rules, such as, for example, a rule that distributes a call to the agent with the least talk time among available agents - essentially aimed to keep all agents equally busy.
After a queue has been created, it can be assigned with greetings, messages, and hold music as well as triggers to determine what to do if the queue is too busy. When triggers are activated they will handle calls overflow by transferring calls to other queues, voicemails, call back requests etc.
Agents are not limited to one queue. They can be assigned to belong to several queues at once. For such agents, if call load becomes too heavy, they can easily log themselves in or out of queues.