Deep diving in mammals
I imagine that their breathing is controlled in the same way as ours. During a dive, oxygen will be used up and carbon dioxide will be produced, dissolving in the blood as bicarbonate and tending to decrease the pH of the blood.

Peripheral chemoreceptors in the circulatory system detect all of these changes and signal the need to breathe. This would tell the seal that it is time to head for the surface.

Diving mammals have various adaptations for prolonged diving, most importantly large reservoirs of blood containing haemoglobin which is oxygenated before a dive, as well as high concentrations of myoglobin in muscle which can also act as an oxygen reservoir.