Why is water a liquid, when it is made
up of hydrogen and oxygen, which are both gases?

Daniel Schumayer, a physicist at Otago University, responded.

There are eighty stable elements naturally occurring on Earth, but we
experience an abundance of different substances. How is this possible?
This is similar to the concept of an alphabet; we have finite number of
symbols, the letters, from which we build up the plethora of words. We
do this by "gluing" one letter to another. Elements can do the same, but
the "glue" is called a chemical bond. Not only atoms, but molecules may
also establish bonds with other molecules, similarly to how we form
sentences from the individual words. The answer to your question,
therefore, must lie in the ability of water molecules to bond together.

Each atom has a positively charged core surrounded by a cloud of
negatively charged electrons. Although the water molecule is
electrically neutral, the electrons are not distributed uniformly; the
oxygen becomes slightly negative, leaving the hydrogen atoms slightly
positive. If there is another water molecule nearby, the slightly
negative oxygen of the first molecule will attract the hydrogen atoms of
the other molecule, since those are slightly positively charged. This
electrical attraction forms a bond, called a hydrogen bond, between the
two molecules. But the hydrogen atoms of the first molecule are still
"free", and therefore able to bind with a third molecule in the very
same way. The molecules thus end up forming large clusters in which they
are bound to one another.

Hydrogen bonding explains the unusual properties of water. Since the
molecules have strong tie to their neighbours, they cannot freely rush
around in the entire volume available to them like in a gas, but they
can only move by tumbling over each other, i.e. flowing. The hydrogen
bonds bind water molecules so strongly, that water has a much higher
boiling temperature, 100 Celsius, than compared to other molecules also
containing hydrogen bonds; e.g., hydrogen-fluoride boils at 20 Celsius,
and hydrogen-chloride does so at minus 85 Celsius. Inter-particle forces, in
general, are responsible for whether a substance is solid, liquid or
gaseous. Hydrogen itself becomes liquid if it is cooled down to minus 253
Celsius, or solid below minus 259 Celsius. Oxygen undergoes the same
transitions; liquid below minus 183 Celsius and solidifies below minus 219
Celsius.

Isn't it fascinating that our lives, which so strongly depends on water,
may only exist because of these relatively strong hydrogen bonds?