I work in the wafer sort area of a semiconductor manufacturing plant; that means we test all the chips when they are still die, as part of a silicon wafer.
In most cases, when there is one device that comes in several "flavors" based on performance, such as the rated frequency, it's all based on how the die tested out. They all come off the same wafer, it's just that the ones that have better test results will get labeled 20mhz, and the ones that don't will get labeled something lower. Same thing with computer processors. Often a part will run far over its rated speed, but it tends to suffer in SOME way that makes it fail a certain test. For hobbyist purposes, we'll probably never even notice that, as we aren't generally pushing our PICs to the absolute limits of their ratings in all categories.