During WWII production of M1 carbines and M1 rifles ("Garands") (and M1911A1s?), manufacturers were forced to submit components for cross-manufacturer fitting. This was a Pretty Big Deal for the time and caused some consternation for some manufacturers.
Before that, firearms were largely hand-fitted and parts were hand-tuned to work together. Machining tolerances were not quite good enough to mass-produce parts for tinker-toy builds like we enjoy today with AR platform. As such, once a functional firearm is complete, the S/N (or parts of) is stamped on core components that are likely to be finicky if swapped.
Two of the popular-yet-notorious platforms to "rebuild" with fresh parts are the P08 Luger (just about everything) and the M1911 (slide, barrel).
_________________________
Rob