Over time, "spænan" evolved into "spaying," which originally referred to the castration of both male and female animals. However, in modern English, "spay" specifically refers to the surgical removal of a female animal's ovaries and uterus.
This is because, in veterinary medicine, the procedure of removing the ovaries is often done in conjunction with removing the uterus. This is called an ovariohysterectomy, and the term "spay" is a simplified and common way to refer to this procedure.