Rivers are formed over thousands of years, as excess rain and melted snow or ice from glaciers makes its way from the land to the sea. Water drains though the ground into small streams, which join up with others as they flow downhill, eventually forming a river in the bottom of the valley.
Over thousands and thousands of years, the water erodes a channel for itself. Because the flow of water is not even, the river bed can be carved into curves as one side is eroded more than the other and the position of the river bed can change.
The power of erosion by glaciers, snow and rivers is enormous and over millions of years they grind down the entire mountain chains.