Back in 1915, Einstein published his theory of relativity which since has been scrutinized without dispute. His theory of relativity states that the laws of physics are the same for all non-accelerating observers and that the speed of light in a vacuum is independent of the motion of all observers. Making space and time relative and bringing them into a single continuum, dubbed space-time.
Einstein’s theory essentially states that objects with large mass will alter the space around it, think of it like a bowling ball on a trampoline. With the gravitational pull causing space to bend in such a way, light should bend when traveling through this “warped” space, but in such a small amount it was difficult to test.
Meaning that in theory, lights from stars sitting behind the sun should be altered by the sun’s gravitational field, but on a normal day, the sun’s brightness made it impossible to see. During a total solar eclipse, however, it is possible to view them due to the darkness. In 1919, Eddington conducted an experiment, measured the positions of the stars that sit behind the sun, and confirmed Einstein’s theory.
This experiment can be hard to visualize so I suggest watching the video below. And if the theory of relativity really interested you, here are some detailed articles.