Oysters can change their gender multiple times in their lifespans.
Within 12 hours of their birth, oysters begin pulling calcium out of the water to create their signature shells. For the first few weeks of their lives, these newborn bivalves zoom around in a current until they eventually settle on some hard substrate, whether it’s a rock, pier, or another oyster. This place of protection is where the oysters will spend the rest of their lives (which can be as long as 20 years). Eventually, usually a year after birth, it’ll be time for the oysters to breed, and that’s where things get interesting.
Although born male, oysters have the impressive ability to switch their sex, seemingly at will. Every season, females can release up to 100 million eggs, and the amount of sperm released is so high it’s essentially incalculable. Once the egg and sperm are released, the oysters rely on pure chance for fertilization to take place, as the egg and sperm meet in the open water. Because any resulting larvae are extremely vulnerable to predators (especially filter feeders), oysters have evolutionarily compensated by being one of the most virile and sexually flexible species in the world — meaning that their ability to change sex likely evolved as a matter of survival. This impressive fecundity means that natural oyster reefs can grow to tremendous size; as little as 10 square feet of reef can house up to 500 oysters. Scientists theorize that water temperature could play a role in triggering whatever causes an oyster to change its sex, but many aspects of the process remain a mystery.