A valley is a deep, long depression in the landscape that has usually been cut by a river (V-shaped valley) or a glacier (U-shaped valley). In a very few cases it has been formed by earthquakes. This gives a rift valley.
In hilly country, a river valley is normally V-shaped, with sides that slope down to the river sides. In lowland, there is often a floodplain by the side of the river channel. In mountain areas the river valley has often been changed into a U-shaped valley because, during the recent Ice Age, glaciers filled the valleys. Glaciers only scour the bottoms of their valleys, so they produce deep trenches with near-vertical sides; hence U-shaped.
In places where valleys have been formed without any change by glaciers, the river does not cut the whole valley, just the bottom of its channel. But as it cuts down, so soil and rocks fall into the river and are carried away. So landslides, soil creep and rockfalls above the river gradually wear back the sides to form the valley. The river then carries away everything that is loose and falls into its channel.
River valleys are different shapes in areas with limited rain. The Grand Canyon is one of these. Because there is relatively little rain, the valley sides are not covered with grass and soil. These would normally give a smooth shape. Instead the rocks in the sides are exposed. In the case of the Grand Canyon the valley sides are made of layers of rock with different hardnesses. Landslides and rockfalls on the sides pick out these differences to make a natural staircase down the sides.