Highway code rule 126[0] says 2?
[0] https://www.gov.uk/guidance/the-highway-code/general-rules-t...
At any time, a child could run out from a hidden spot and the car in front of you could have to slam on the brakes as hard as possible. Or any of a hundred other realistic scenarios.
These things aren't common, but statistically they will happen to you multiple times during a lifetime of driving, and it's your responsibility to always be at a safe distance behind in order to react as well.
The common rule of thumb is generally 2-3 seconds in perfect conditions, and 4-6 seconds in rain or other normal bad weather. 10 seconds is only in cases of ice/snow where most people wouldn't be driving in the first place (you know, when you're going just 15 mph but it still takes 5 seconds to come to a full stop on the slippery ice). The heaviness/lightness of traffic is irrelevant.
I've usually heard that it's three seconds. Even still, you control your follow distance. Even in heavy traffic, you can give yourself more space between you and the car in front of you than other people do. It's easy to do, and I've been able to do just that even in metro areas with heavy traffic.