The balanced chemical equation for the reaction is:
\[
2 \, \text{H}_2 + \text{O}_2 \rightarrow 2 \, \text{H}_2\text{O}
\]
This equation tells us that 2 moles of hydrogen (\( \text{H}_2 \)) produce 2 moles of water (\( \text{H}_2\text{O} \)).
From the question, we are given that 4 moles of hydrogen react with excess oxygen. To find the number of moles of water produced, we use the stoichiometric relationship between hydrogen and water from the balanced equation.
According to the equation:
\[
\frac{2 \, \text{mol} \, \text{H}_2}{2 \, \text{mol} \, \text{H}_2\text{O}} = \frac{4 \, \text{mol} \, \text{H}_2}{x \, \text{mol} \, \text{H}_2\text{O}}
\]
Where \( x \) is the number of moles of water produced when 4 moles of hydrogen react.
Solving for \( x \):
\[
x = \frac{4 \times 2}{2} = 4 \, \text{mol} \, \text{H}_2\text{O}
\]
Thus, 4 moles of hydrogen will produce 4 moles of water.