The mechanic is based on probability—if it were certain, the game would break. In rare cases, like a player missing a 90% KO while the opponent lands a 5% KO, the chance is only 0.5% (about 1 in 200).
If you get knocked out when your defense is higher than the opponent’s KO chance, it’s because they reduced your health to zero.