A million fish have died in the Murray Darling basin, as oxygen levels plummet due to major algal blooms. Experts have warned we could see more mass deaths this week.

Read more: Explainer: what causes algal blooms, and how we can stop them

Fingers have been pointed at poor water management after a long period of drought. However, mass fish deaths can also be caused by floods, and even raw sewage.

So what’s going on when oxygen gets “sucked out of the water”?

The phenomenon is very well known to water quality engineers; we call it “biochemical oxygen demand”. To understand it, we need to talk about a little bit of biology and a little bit of chemistry.

When oxygen meets water

Oxygen molecules are soluble in water in the same way that sugar is soluble in water. Once its dissolved, you can’t see it (and, unlike sugar, oxygen is tasteless).

The maximum amount of oxygen that you can dissolve in water depends on a number of factors, including the water temperature, ambient air pressure, and salinity. But roughly speaking, the maximum amount of dissolvable oxygen, known as the “saturation concentration” is typically around 7-10 milligrams of oxygen per litre of water (7-10 mg/L).

This dissolved oxygen is what fish use to breathe. Fish take water in through their mouths and force it through their gill passages. Gills, like our lungs, are full of blood vessels. As water passes over the thin walls of the gills, dissolved oxygen is transferred into the blood and then transported to the fish’s cells. The higher the oxygen concentration in the water, the easier it is for this transfer to occur.

Once in the cells, the oxygen molecules play a key role in the process of “aerobic respiration”. The oxygen reacts with energy-rich organic substances, such as sugars, carbohydrates and fats to break them down and release energy for the cells. The main waste product from this process is carbon dioxide (CO₂). This is why we all need to breathe in oxygen and we breathe out carbon dioxide. Fish do that too. A simple way to express this is:

Organic substances + Oxygen → Carbon dioxide + Water + Energy

What is the biochemical oxygen demand?

Just like fish and people, many bacteria gain energy from processes of aerobic respiration, according to the simplified chemical reaction shown above. Therefore, if there are organic substances in a waterway, the bacteria that live in that waterway can consume them. This is an important process of “biodegradation” and is the reason our planet is not littered by the carcasses of animals that have died over many thousands of years. But this form of biodegradation also consumes oxygen, which comes from dissolved oxygen in the waterway.

Rivers can replenish their oxygen from contact with the air. However this is a relatively slow process, especially if the water is stagnant (flowing creates turbulence and mixes in more oxygen). So if there is a lot of organic matter present and bacteria are feasting on it, oxygen concentrations in the river can suddenly drop.

Obviously, “organic substances” can include many different things, such as sugars, fats and proteins. Some molecules contain more energy than others, and some are easier for the bacteria to biodegrade. So the amount of aerobic respiration that will occur depends on the exact chemical nature of the organic substances, as well as their concentration.

Therefore, instead of referring to the concentration of “organic substances”, we more commonly refer to the thing that really matters: how much aerobic respiration the organic substances can trigger and how much oxygen this will cause to be consumed. This is what we call the biochemical oxygen demand (BOD) and we usually express it as a concentration in terms of milligrams of oxygen per litre of water (mg/L).

Like us, bacteria don’t consume all of the food which is available to them instantly – they graze on it over time. Biodegradation therefore can take days, or longer. So when we measure the BOD of a contaminated water sample, we need to assess how much oxygen is consumed (per litre of water) over a specified period of time. The standard period of time is usually five days and we refer to this value as the BOD5 (mg/L).

As I mentioned earlier, clean water might only have a concentration of dissolved oxygen of up to around 7-10 mg/L. So if we add organic material in a concentration which has a higher BOD5 than this, we can expect it to deplete the ambient dissolved oxygen concentration during the next five days.

Read more: More of us are drinking recycled sewage water than most people realise

This phenomena is the main reason for which biological sewage treatment was invented. Raw (untreated) municipal sewage can have a BOD5 of 300-500 mg/L. If this were discharged to a clean waterway, the typical base-level of 7-10 mg/L of oxygen would be consumed, leaving none available for fish or other aquatic organisms.

So the purpose of biological sewage treatment is to grow lots of bacteria in large tanks of sewage and provide them with plentiful oxygen for aerobic respiration. To do this, air can be bubbled through the sewage, or sometimes surface aerators are used to churn up the sewage.

By supplying lots of oxygen, we ensure the BOD5 is effectively consumed while the sewage is still in the tanks, before it’s released to the environment. Well treated sewage can have a BOD5 as low as 5 mg/L, which can then be further diluted as it’s discharged to the environment.

In the case of the Darling river, the high BOD load was created by algae, which died when temperatures dropped. This provided a feast for bacteria, lowering oxygen, which in turn killed hundreds of thousands of fish. Now, unless we clean the river, those rotting fish could become fodder for another round of bacteria, triggering a second de-oxygenation event.