TCP uses congestion control algorithms to dynamically adjust the transmission rate depending on network conditions. It uses three main algorithms:
1. Slow start exponentially increases the congestion window when no congestion is detected.
2. Congestion avoidance additively increases the window when congestion is detected to slow growth.
3. Fast recovery allows additive increases when duplicate ACKs are received, indicating a lost packet but not severe congestion.
TCP detects congestion through timeouts or duplicate ACKs and multiplicatively decreases the window size by half in response to avoid worsening congestion. It transitions between these algorithms depending on congestion signs to maximize throughput while avoiding network overload.