Gravitational lensing is one of the more bizarre consequences of General Relativity. Mass warps space-time, so that the shortest path between two points is no longer a straight line, it's curved.
The warped space acts like a lousy lens, distorting images of background galaxies into arcs — like looking through the base of a wine glass.
This artist's impression simulates flying past a galaxy cluster and seeing the gravitational lens from different perspectives
https://esahubble.org/videos/hubblecast70c/