They eat their prey head first, by unlocking their jawbones. They are completely helpless while they are eating and are not able to defend themselves. Rattlesnakes can bite without injecting venom. They usually save their venom for their prey. The king snake is totally immune from the rattlesnakes venom.
Rattlesnakes use their rattle as a warning to others to stay away.
The king snake is deaf though, and can't hear the rattle noise. What is really strange is that rattlesnakes know this, and will stop rattling once they realize that it is a king snake they are trying to scare. It just starts rubbing against rocks to loosen the skin around its jaw first. Then it will keep sliding in, around and through the rocks, loosening and sliding out of the skin as it goes. Just like with people, the snakes first layer of skin is dead.