When electric current is passed through the water it breaks down the components of water that is hydrogen and oxygen. Hydrogen atoms obtained are 2 and oxygen is 1.
So water is collected in the tubes in the ration 2:1 . This process of breakdown of water in its constituents is known as electrolysis of water.