Chats are assigned to agents according to the instance-wide Automated Chat Distribution (ACD) setting. By default, this is set to "Manual", meaning that all agents whose skills match the routing rules applied to the incoming chat are notified when a chat is available. The first agent who clicks to "grab" the chat becomes assigned to that chat session.