The User-Agent header identifies the browser and OS making an HTTP request. Anti-bot systems flag requests with non-browser UAs (Python requests default `python-requests/2.x.x`) or with outdated browser versions. User-agent rotation cycles through a pool of realistic, up-to-date browser UA strings to avoid these signals.
Effective UA rotation goes beyond simply changing the UA string. The rest of the request headers — Accept, Accept-Language, Accept-Encoding, Sec-Fetch-* headers, and HTTP header order — must be consistent with the claimed browser. A request claiming to be Chrome 125 but sending Firefox Accept headers is internally inconsistent and detectable by fingerprinting systems.
For browser-based scrapers, the UA is set on the browser context level and automatically propagates to all headers in a coherent way. For HTTP-based scrapers, the entire header set for a given browser/OS combination should be applied as a bundle rather than swapping the UA string in isolation.