The moving water moves something in a generator
As the water moves, it exerts force on a part of the generator, causing it to spin. That part of the generator is linked to a metallic part that also spins. The metallic part is surrounded by magnets, and the spinning motion creates electric current.