When tadpoles first emerge from their eggs their gills are on the outside of their bodies, like little fans on the sides of their head trapping oxygen for the taddy to breath. Because they are so small at this stage it is not easy to see and they quickly develop and their gills are incorporated into their bodies.
Because frogs often lay their spawn in still water, as the puddles dry up, they lose their oxygen content and so the tadpoles need to find air in different ways. This is why you often see tadpoles popping to the surface for a quick gulp of air before diving for their hiding spot on the bottom of a pond again. They are just trying to breath.
Frogs also have a curious relationship with oxygen. Their skin is a very porous membrane and so substances pass easily through it. So oxygen from the water in which they are swimming is absorbed through their skins and this is why they can swim under water for a long time to evade a predator. They literally breath underwater!
This ability to absorb things through their skins is also why we need to protect our ground water from chemicals. Anything that is present in the environment will be absorbed by the frogs and this can be very hazardous to their delicate systems.