Why mass bends light
Gravitational lensing is a prediction of Einstein's general relativity: mass curves spacetime, and light following the straightest available path through that curved geometry appears to bend as it passes a massive object. A galaxy or cluster lying between a distant source and an observer can therefore deflect and focus the source's light, acting like a natural lens. The 1919 solar-eclipse measurement of starlight deflected by the Sun was an early confirmation of the effect.
Strong, weak, and microlensing
Lensing appears in three regimes. Strong lensing produces dramatic, visible distortions: multiple images of a single source, magnified arcs, and the complete Einstein ring seen when source, lens, and observer align precisely. Weak lensing causes only slight, statistical distortions in the shapes of many background galaxies, and is used to map dark matter. Microlensing is a brief brightening as a compact foreground mass passes in front of a star, used to detect faint objects and exoplanets. Because lensing responds to total mass including unseen matter, it is a key probe of dark matter distribution.