The first stage in the formation of a sedimentary rock is the deposition of sediment. The size, shape and type of sediment can tell you lots about the depositional environment.
In a high energy environment, such as a river bed, currents are able to carry large particles. When the current loses energy, these will be deposited. Low energy currents cannot carry large particles, and so fine grained rocks form in a low energy environment.
As particles are transported, they are constantly eroded, decreasing the size of particles and increasing their roundness. Particles that have been transported contain well rounded particles or hard minerals such as quartz. These rocks are said to be more mature. If particles have not been transported as far, particles will be more angular, and softer, more easily destroyed minerals such as feldspar may still be present.