James Clerk Maxwell did indeed make significant contributions to the understanding of light and electromagnetism with his formulation of Maxwell's equations in the 19th century. These equations described the behavior of electric and magnetic fields and predicted the existence of electromagnetic waves, including light.
Maxwell's equations, combined with experimental evidence, suggested that light propagated as an electromagnetic wave and that its speed was constant in a vacuum. This implied that the speed of light would remain the same regardless of the motion of the observer. This principle, known as the constancy of the speed of light, was a crucial step in the development of the theory of relativity.
While Maxwell's work laid the foundation for understanding the behavior of light, it was Albert Einstein who formulated the theory of relativity. Einstein's theory, particularly his special theory of relativity published in 1905, revolutionized our understanding of space, time, and motion.
Einstein's theory incorporated and expanded upon Maxwell's ideas, introducing the concept of the speed of light as a fundamental constant of nature and showing that the laws of physics should be the same for all observers in uniform motion. Einstein's relativity theory provided a deeper understanding of the nature of spacetime and the relationship between matter, energy, and gravity.
In summary, while Maxwell's work was crucial in establishing the constancy of the speed of light, it was Einstein who developed the theory of relativity, which built upon and extended those ideas to form a comprehensive framework for understanding the fundamental nature of the universe.