Maxwell's equations showed that (1) a changing magnetic field produces an electric field and (2) a changing electric field produces a magnetic field.
Combining these suggested the possibility that perhaps they could be combined in such a way as to co-operate with one another. That is, each could create and sustain the other. In effect, radiate away from a source.
Maxwell was convinced this could happen but the self-sustaining pattern would have to obey certain constraints. One of these was that the pattern of fields would have to travel through space at a speed precisely determined by the Maxwell equations.
When Maxwell was able to determine the value for c given by the constants used in his equations he found that it matched almost exactly to the (then) determined value for the speed of light.
The question then became "speed relative to what?"