https://en.m.wikipedia.org/wiki/Snake_venomCobras are snake eaters...as are other snakes besides the kingsnake. King cobras eat other cobras...they are mostly immune to cobra bites...
Most venomous snakes are believed to be mostly immune to the bites of their own species.
Here it says rat snakes and couple others are immune to viper bites.
Kingsnakes are not nescessarily immune to the venom of snakes not found in its range.