CPUs are "binned" according to the quality of the wafer...for example...the FX 8320 and FX 8350 are the same CPU with the exception of factory clock rating. The FX 8350 is "binned" higher, meaning the silicon wafer is of higher quality and tolerates higher clocks more easily.
This comes down to Quality Control by the manufacturer.
You can look at historical averages of the specific CPU in general, if the majority are able to achieve a fairly high overclock, then the QC is typically considered to be good. If, the majority achieves a relatively low overclock...(like 4th gen Intels)...the QC is typically considered to be bad, or the yields from the silicon process they use are low.
In general, because AMD uses Partially Depleted Silicon On Insulator wafers (PD-SOI) their wafers are typically of higher quality than Intel. So they run cooler and achieve higher clock speeds than Intel. Intel's process is more advanced using 3 gates instead of 2, but they use a much cheaper wafer (bulk, in fact)...so their CPUs tend to run hotter and often achieve lesser overclocks compared to AMD hardware.
This accounts for why AMD currently holds every record for overclocking CPUs that is currently tracked. It also accounts for why thermal envelopes on AMD CPUs cutoff at 62C while Intel CPUs will go as high as 90C.
Depending on the CPU you choose, "binning" of the chip has an impact on the overclock you can achieve, but the motherboard VRMs, cooling system in place, and stability of voltage to the core (vcore) are also important factors as well.
On a given motherboard you might achieve an overclock up to 4.4 GHz on a given CPU, on a higher end board designed for overclocking, you might achieve something like 4.9 GHz. So, there are a lot of variables, the quality of the wafer is definitely one of them though.