My dad worked at a nail manufacturing plant. I think there were a few reasons.
The longer the mechanism, the more chances something will break down. Separate machines allow a sort of division of labor.
Most nails are cold-stamped from coils. The coils are extremely heavy and it takes large equipment to move them.
Most nail stamping machines can be set to different lengths, gauges, and head sizes, so you have to use different packaging for each kind.
In some cases, they get “hot dipped” (galvanized) after they are cut and stamped but before they are packaged.
That is the extent of my nail knowledge. They originally made barbed wire and “tamed the west.”