Glocks are, like most modern designs, pretty much interchangeable, but that doesn't mean they are guaranteed a drop in fit. Unlike the AR15, and even it has issues if you assemble one from piles of parts.
It's a matter of the factory knowing that certain parts require they have dimensional compatibility. The +/- .015" has to be a good working relationship at the barrel cam, hood, slide, etc. If they are both on the tight side parts tend to hit instead of just clear, or gall instead of slide. Engineers work most of those kinks out but it's a continuing exercise as the parts are measured in production and then batch matched to the others as the stream into assembly. They choose which combinations to put into a gun, which makes the work well, and also saves them scrapping a whole bunch of stuff simply because it was all a tad too tight. Or loose.
We see this with AR building when an upper from one supplier and a lower from another are pinned together - or not - because the takedown holes either match coaxially and in size, with correct pin sizes, or you get the dreaded deadblow hammer out to make them fit the first 100 times. And the next gun? Loose as a Basic Training cycle gun with a lot of miles on it. Fortunately for the AR15 it's almost harmless, but for the lockup of barrel to slide in the frame, it can cause issues until all the parts can work together. You can't just drop in parts, and the factories don't either. The better ones are very consistent fits despite the parts not always working in some other gun as well.
It's even an issue with magazines - first recommendation for sciencing out FTF or FTE is change mags. The amount it presents to the slide and at what angle the ammo is pushed forward to hit the ramp is critical to feeding. In one study of mags that were designed for a combat weapon, a matter of .020" was all it took in mag width front to back - the looser ones rocked forward when chambering and it would cause FTF with ball ammo.
Promag anyone? Right - they have to fit and fit well, same as any other part of the gun. Again, the makers finesse this stuff before releasing it, the aftermarket will not have that proprietary information and cannot control the variations that exist in guns already being used and with higher round counts. So, you have to see how parts fit and if they will work.
No different with engines, valves, pistons, rings, and bearings have to be fitted. In some cases a matter of .005" could be catastrophic. Guns are a little bit more a clanky looser fitting machine but it doesn't mean it won't make a difference. Open the hollow point mouth a tad bigger on .45 ammo and have it snag the interrupted feed ramp on a 1911 and you get stoppages. Even ammo is an issue.
Shoot out the new parts same as a new gun to ensure correct working relationships, which also goes to taking it apart and inspecting the wear points to see if things are working together correctly. If you replace a part - you are the factory QC man for your one part assembly now.