There are many dangers in the natural environment that tree-frog eggs have to face. Fish love to eat the eggs, as do other predators, so adult frogs can lay their eggs on foliage hanging over ponds. There they confront threats from wasps and snakes. Embryos therefore, have to be ready to escape their eggs in an instant if they sense the vibrations of an impending attack. But false alarms come from weather, and premature frogs don't fare as well, so early hatching also comes with a price.
Researchers have used electron microscopy and videography to investigate the hatching mechanism in depth. High-speed video showed three stages of the hatching process. First was pre-rupture shaking and gaping, followed by membrane rupture near the snout, and finally, physical thrashing to exit through the new hole. It took from 6.5-49 seconds for embryos to hatch.
The investigators also determined that embryos start to move their mouths a lot just before hatching, and that fluid came from their mouths at this time. They posit that hatching glands, densely concentrated around the snout, are likely releasing enzymes that aid in the formation of the hole through which the embryos escape.