Funding for Nimitz was authorized in 1967 they started construction the next year and it was in service in 2025. The US has a very large and very expensive carrier fleet today because people decided it was worth having X boats a long time ago and they calculated X under the assumption that a significant number would be spending time docked / on the other side of the planet from where the conflict is.
Obviously, part of that equation was based around warfare and the likelihood of losing some / extending deployments etc, but what we want today has no barring on what we actually built as all those decisions happened a long time ago.
TLDR; Having more than strictly needed for normal operations = having a surplus when something abnormal occurs.