Are all snakes egg-layers?
The quick answer to your question is no. Certain snake species give birth to live offspring instead of eggs. However, while some snakes give birth to live offspring, the majority do lay eggs. The fact that certain snake species lay their eggs inside the female’s body yet ultimately give birth to live offspring is even more astonishing. Most snake species, such as rattlesnakes, vipers, boas, and the majority of sea snake species, reproduce by depositing eggs, whereas just 30% give birth to live offspring.
The majority of snake species in the world lay eggs, including cobras, adders, mambas, taipans, and other members of the Elapidae family, which makes up 2/3 of all snake species. The majority of sea snake genera give birth to live young, however the oviparous Laticauda genus lays eggs instead of giving birth to live young like the other sea snake genera.
Most of the time, female snakes leave their eggs soon after they are laid.
However, a few species may actually coil around the eggs to keep them warm until they are ready to hatch. The mother of the very venomous king cobra (Ophiophagus hannah) constructs the nest and even stays with the young after they hatch. One explanation is that having live young rather than laying eggs has a survival benefit. Egg-laying snakes, with the exception of King Cobras (Ophiophagus hannah), do not construct their own nests. Instead, they lay their egg clutches in heaps of vegetation, alligator nests, or any other place where the eggs may develop to hatch at the right temperature and humidity (eggs can and do dry out).
A suitable location is one that can sustain an adequate range of temperatures and moisture for up to 50 to 60 days since snake eggs can take that long to hatch. A desirable location is therefore one that can sustain a suitable range of temperatures and moisture for up to two months. The issue is that places like that aren’t always easy to find in colder regions. Therefore, snakes that carry live prey have an edge.
Snakes are able to do things that an egg clutch cannot because they maintain their growing embryos inside of their bodies. They can relocate to a better location. An advantage over a snake who just deposits her eggs in a favorable location and waits for the best will go to a snake that can actively seek for favorable incubation circumstances.