You choose the appropriate gas for the depth and duration that you plan to dive for.
The oxygen content of a gas mix will determine its 'Maximum Operating Depth' (MOD), due to the risk of oxygen toxicity (Ox-Tox) at elevated partial pressures (pp).
Increasing the oxygen content of air will increase your No-Deco Limit (NDL) because you are replacing nitrogen (the inert gas responsible for DCS) with oxygen (which doesn't cause DCS because it is metabolised by the body). The higher the percentage of oxygen, the less nitrogen is absorbed by your body. However, the higher the percentage of oxygen, the shallower you have to stay due to Ox-Tox risks.
On deeper dives, the nitrogen content of the gas also contribute to Inert Gas Narcosis. Narcosis is the anasthetic property of certain gasses at elevated partial pressures. Nitrogen Narcosis is a debilitating mental impairment that causes considerable danger to the diver.
To prevent/minimise the onset of Inert Gas Narcosis, divers can utilise Helium within their gas mix. Helium causes little or no narcosis within diveable depths. The addition of helium to a gas mix replaces nitrogen and/or oxygen. The exact mix/mixes of the gas/gasses used is determined by the depth/s that the diver plans to operate at.
Different agencies advocate using helium beyond varied depths. Typically, for cave diving, it is essential beyond 30-50m depth.