Genetics help greatly. Big hands, forearms, etc. But also form and accuracy play a major part.
Many of the knock out artists of legend, usually knew how to throw a punch (and I mean from the legs upward), so they knocked out guys due to the technique. Foreman was a mountain of meat, as was Frazier so its no surprise that F=MA, which mean people were going to get KO'ed constantly. This also means that said champions were inside fighters. If you notice, while the opposite does happen, the brunt of knockouts happen from the pocket, not outside. Which means they have to know how to land uppercuts and hooks correctly.
Other times you get guys who run into hooks or jabs. Said fighters know how to time this perfectly like; Pac, Roy Jones, Foreman, etc. Then glass jaws are also the real spotlight here as well. A lot of fighters either don't have the jaw or the tenacity to stay in a fight. Evander had both against Tyson, Buster Douglas, tenacity.