Sometimes (though not very often) a piece of ovary can be left in. Even a good surgeon can make a mistake. When the doctor ties off the pedicle (the arteries and veins that feed the ovary) they try to tie it as close to the body wall as they can to ensure all of the ovarian tissue is taken out. Sometimes if there is a lot of fat encasing the ovary, or if the ovary is cystic this can be harder meaning there is more chance that a few small pieces of ovary will be left behind. It really only takes just a few cells being left behind to make enough hormone for you to see signs of heat.
Sometimes females will have a small piece of ectopic ovarian tissue. That means there is ovarian tissue growing somewhere else in the body. Of course when a cat comes in for a spay the vet doesn't think to look elsewhere so it gets left in.
Usually our vets request that you bring you cat in while it is showing signs of heat so that the tissue is active and easier to find.