Einstein’s theory of general relativity tells us that matter and energy bend and warp the fabric of spacetime. Indeed, this bending and warping is exactly what we experience as the force of gravity, since the deformations in spacetime instruct matter how to move. This bending doesn’t just apply to matter, but also to light.
The means that gravity bends the path of light in a phenomenon known as gravitational lensing. This was one of the first predictions of the theory of relativity, and an expedition led by Sir Arthur Eddington to observe the bending of starlight during a total solar eclipse was the first test of Einstein’s famous theory.
There are three kinds of gravitational lenses, divided into how strong the effect is.
The first kind is called strong gravitational lensing. Astronomers see this kind of lensing around gigantic clusters of galaxies. When light from background galaxies passes through or near the cluster, that light bends, distorts, and even sometimes follows separate paths. The background galaxy then appears warped and distorted, and in some cases can appear in multiple locations around the cluster.
The second kind is much weaker, and hence is called weak gravitational lensing. This is caused by the light from distant galaxies passing through billions of light-years of cosmic structure on its way to our telescopes. This won’t visibly distort the images of galaxies, but gently tweak them. Astronomers use this mild distortion to estimate the amount of matter between us and the galaxy, helping them to build maps of the universe.
The last kind if called microlensing, and is by far the weakest, as its name suggests. When a small object passes between us and a star, the image of the star will briefly appear to flare and brighten, due to multiple beams of light from the star getting focused around the object. This technique allows astronomers to discover otherwise invisible things like black holes and rogue planets wandering the galaxy.