The idiomatic expression that cats have nine lives comes not from a literal reality in which cats have an arbitrarily limited immunity but rather from a myth that is likely related to the domestic cat's impressive agility. However, as a figurative way of describing feline dexterity, the nine lives myth conjures up vivid imagery, which may be why William Shakespeare referenced it in his famous tale of star-crossed lovers, "Romeo and Juliet." Overall, it is difficult to pin down an exact origin for this myth, including an explanation for the specific number nine, though it may have origins in Egyptian or Chinese belief systems that ascribe special significance to the number nine.
The root of the ancient Egyptian emphasis on the number nine is related to the sun god Atum-Ra. This god was supposed to be able to take on a cat's form, and, because he was said to have given birth to eight other gods, Atum-Ra represented the concept of nine lives in a single being. In China, the number nine is considered lucky because of how well divided it is, representing three groups of three. There are other cultures that believe that cats have multiple lives, but the number value does not always equal nine, indicating that the myth is probably simply related to a cat's superior ability to survive falls.