Many people don't realize it, but testicles don't always end up where they are supposed to. No, get your head out of the gutter! This is strictly a medical discussion.
In a fetus the testicle develops in the abdomen near the kidneys. As the fetus and eventually the baby grows, the testicles move lower in the abdomen, migrate through the inguinal ring (in the groin), then under the skin and finally into the scrotum. At any point along that journey one or both testicles can stop. This condition is called "cryptorchidism" ("crypt-" meaning hidden and "-orchid" referring to the gonads). Though it's not common, I see several cryptorchid patients every year.
Normally by the time a puppy or kitten is two months old we should be able to feel both testicles. Sometimes they can be delayed in descending, but they certainly should be in the scrotum by four months old. We always check the testicles at each visit to make sure they are where they should be. If a testicle is retained, it can be under the skin next to the penis, under the skin in the groin, or within the abdomen. If it's under the skin it's simply a matter of making a second skin incision and removing it. If the testicle is in the abdomen we have to make an incision in and explore the abdomen. Sometimes the testicle is sitting near the incision in the middle of the abdomen and it's simple to grab it, tie off vessels, and remove it. However, there have been situations where the cryptorchid testicle is really hidden and difficult to find. In one case early in my career I had a testicle simply not develop. I found the vessels, vas deferens, and other associated structures, but gonad itself wasn't there. I've had testicles stuck in the inguinal ring, and one situation where I pushed it through the inguinal ring while I was exploring the abdomen and then had to remove it from under the skin after closing the belly.
Why is this necessary? A retained testicle will function relatively normally, producing testosterone and sperm. Cryptorchid pets will act like any intact male and can potentially even reproduce (though this isn't recommended since this is a genetic tendency). The biggest concern is that eventually the retained testicle may turn cancerous, especially within the abdomen. Testicles in most mammals are not designed to be constantly at normal body temperature, which is why they hang slightly outside of the body.
Yes, I had one of these cases today, and realized that I can't remember blogging about it before. The patient today was an Australian shepherd, and the surgery was pretty quick and easy. With an experienced vet most of these cases are fairly straight-forward and no more invasive than a spay. If you have a situation like this, talk to your vet and have your pet neutered.