This assumption is untrue at very low speeds, particularly when it takes longer than 2 seconds for a car to pass a point. For instance if we assume cars are 4m long, then with an interval of 2 seconds the cars would be touching at 4.47mph
The assumption is also untrue at very high speeds. You'll want a larger gap. That's partly because at such high speeds the ability of a vehicle to decelerate differs - if a vehicle with good brakes does an emergency stop and the car behind it has a respectable 2 second gap but has worse brakes then they can end up colliding. It's also partly because a 2 second gap at very high speeds means the car in front is further away, and that can cause a greater delay before the driver realises what is happening. As a third reason a greater margin needs to be used at very high speeds simply because the consequences of a crash are that much greater and should therefore be avoided even more than at lower speeds.
Therefore there is a kind of U-shaped curve in the "safe" following interval, and consequently a speed at which safe throughput is maximised.
That's why variable speed limits have been introduced in various places. For instance, in the UK which normally has a 70mph speed limit on motorways, in very high traffic conditions this can be lowered using electronic signs to increase the safe throughput of the road. It's commonly reduced to 50mph, though it does get lowered further in sections approaching a queue of vehicles that has actually stopped.
There's also the issue of speed oscillations. With a high speed limit and vehicles following too closely, a little variation in speed in one vehicle can turn into a larger variation in the following vehicles, causing a backwards-travelling wave of braking (sometimes to an absolute halt) and speeding up again. Lowering the speed limit reduces this.