The balanced chemical equation for the reaction is:
\[
2 \, \text{H}_2 + \text{O}_2 \rightarrow 2 \, \text{H}_2\text{O}
\]
This equation indicates that 2 moles of hydrogen (\( \text{H}_2 \)) yield 2 moles of water (\( \text{H}_2\text{O} \)).
The problem states that 4 moles of hydrogen react with excess oxygen. To determine the moles of water produced, we utilize the stoichiometric ratio of hydrogen to water from the balanced equation.
Based on 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}}
\]
Here, \( x \) represents the 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}
\]
Therefore, 4 moles of hydrogen will produce 4 moles of water.