Gravitational lensing is an effect in which the measured images of background galaxies appear distorted owing to the bending of light rays by matter along the line of sight between us and the distant galaxies.In the "strong lensing" regime the distortion is non-linear and can result in multiple images of the same background galaxy: in "weak lensing" the effect is much weaker but can still be detected statistically.
In practice, we make a survey of a large contiguous area of sky and measure the shapes of as many galaxies as possible: in particular, we measure the apparent ellipticity of each galaxy. In the absence of gravitational lensing, we expect galaxies to have largely uncorrelated shapes (ellipticities), but the presence of a clumpy distribution of matter causes a correlation between the apparent shapes of galaxies that can be measured.
The spatial variation (in angular sky coordinates and measured as a function of the background galaxy redshift) of the lensing signal is directly relatable to the spatial variation in the distribution of matter in the Universe, which in turn tells us about what the characteristics of "dark matter" are (lensing is sensitive to any type of gravitating matter, but the evidence is that the matter content of the Universe is dominated by "dark matter").
By comparing how the lensing signal varies as a function of the redshift (i.e. distance) of the background galaxies, we can also infer the rate of growth of cosmic structure with cosmic epoch, which in turn places constraints on the values of cosmological parameters in the standard cosmology paradigm.
However, we may also attempt to use lensing to test the cosmological model, and in particular use it to search for departures from General Relativity, by comparing lensing signals with what we would expect from other non-relativistic tracers of the Universe's matter distribution, such as galaxy clustering and velocity distributions.