CO 2 is the main thing that will control the rate and depth of breathing. This is due to aerobic respiration at the cell level. Alveoli in the lungs have a greater O 2 concentration than the capillaries running past, so the O 2 diffuses into the capillary to attach to red blood cells to be taken to the body (to be used for cell metabolism). There is a higher concentration of CO 2 coming from the body (waste product of cells) in the capillaries, so this diffuses into the alveoli to be breathed out.
In more detail, After using O 2, Mitochondria produce CO 2 which diffuses into the water in the bloodstream to create carbonic acid.
CO 2 + H 2 0——> H 2 CO 3 ==> H+ ions + HCO 3 + ions
These ions are attached to the red blood cells, which are also carrying heomoglobins which transport oxygen to release in the cell. They also pick up the HCO 3 ions and transport to the lungs, where they are released and go back to being H 2 CO 3.
So anyway, hyperventilating causes your O 2 concentration to rise and your CO 2 concentration to drop, which will eventually cause you to pass out if you can’t stop. So breathing into a paper bag and then re-breathing that same air will mean that you are breathing in CO 2 instead of O 2 which should bring both levels up to normal, just don’t keep breathing the CO 2 cause you will suffocate yourself!
Nimis is right, there’s something in there about the pH and stuff but I’m not quite sure where that fits in or how it works, I’m sorry. I may have got something wrong up there, this is only from year 11 Biology haha.