Task allocation in swarm intelligence focuses on assigning tasks to individual agents to optimize overall performance. This decentralized approach allows agents to autonomously choose tasks based on local information, leading to self-organization and efficient division of labor. Key advantages include flexibility, robustness, and scalability. Inspired by social insects, task allocation mechanisms range from threshold-based methods to market-based approaches. Mathematical models and algorithms help implement these concepts in robotics and other applications, despite challenges in scalability and adaptability.