The logic is simple, if not the actual execution. Meditators also do extra inhalations before holding their breaths. It is sometimes called chi-packing. After we hold our breath for a certain period of time (depending on individuals), the urge to breath will create a panic reaction in our body. And this panic reaction will in turn cause involuntary contraction of our breathing muscles. It is highly dangerous for a diver doing free diving. He therefore has to "fight against" these panic reaction and involuntary muscular contractions. Training of which is through the practice of holding breath in yoga or Taoist meditation.
In training terms, firstly the meditator has to consciously relax his body, but that is not enough. When his body (blood) has a higher and higher level of carbon dioxide, his breathing muscles will have bursts of involuntary contractions. The training mechanism is to focus our mind to consciously relax the particular muscles that go into involuntary contraction - burst by burst. When this initial stage is passed, our mind will go into a state of joyous (spiritual) detachment, due to an increase level of carbon dioxide and total bodily relaxation. The reduced level of metabolism arising from a relaxed body will make further relaxation to ease the urge of involuntary contraction easier. At this stage, the warning signal of the body becomes shut off. For a deep diver, shutting down of our internal alarm system can be dangerous and may cause drowning. For a deep meditator, he has experienced the spiritual zone, the first step of his long journey into the whatever.