There are standards that define and control this, mosty from ANSI. From approximately WW2 until we started moving everything offshore, the manufacture of most hardware adhered to these standards, and it was all great. But then when most hardware manufacture moved overseas, it got pretty bad for awhile, with these new manufacturers making their own estimations on dimensions, or carrying things like screwdriver slot width and depth over from other international standards.
It has all gotten a lot better in recent years, as these offshore fabricators have improved, but I still see a lot of garbage on the consumer market. I buy a lot of screws (more than $19,000 worth of stainless screws last week, alone!), and most of my material is now coming from Taiwan or Thailand. They're much better than 10 or 15 years ago, but of course we may never see the type of consistency that was 1970's American-made hardware.
That said, I would be out of business if I had to buy the same $19k worth of screws from American manufacturers. That'd probably cost me $60k - $100k, based on the present pricing I see for "Made In USA" stainless hardware.
I do have to buy USA screws sometimes, I just got a big project that is government-funded, where they want to see a Country of Origin statement for each component. But my God... the prices they pay are many, many times higher than any commercial requirement would ever allow. When you wonder about the prices paid for toilet seats in the White House, this must be at least part of the reason.