A car generator creates electricity by moving wires through the field of surrounding magnets, and this causes electricity to flow. The effect was discovered by Faraday and Ampere in the mid1800s. They showed that a moving electric charges would create magnetic fields and that electric charges moving through a magnetic field would experience motive force from the field ( this is how the car generator works).
Based on these experimental results, James C Maxwell was able to write an equation that showed if an electric charge were accelerated it would give off an electro-magnetic wave. This wave would effect other electric charges at a distance... this is the principal of the radio.
One interesting thing in all this was that the velocity of these electo-magnetic waves could be calculated from known electrical constants and that this velocity was very close to the velocity of light that was known approximately from astronomical observations.
Therefore, all the scientists immediately realized that light was an electo-magnetic wave and had a speed ( in a vacuum ) as determined by Maxwell's equation.
Now there is something immediately peculiar in Maxwell's formulation .. the velocity of the wave produced by an accelerating electric charge is not relative to any particular co-ordinate system. How could this be !!?. This is to say that all observers will see the same speed of a light pulse, even if the observer is running away from the light pulse 95% of the speed of light, that observer will be overtaken as if he were standing still. Physicists were in a tizzy ..