From our experience in daily life, the speed of light should vary with the frame of reference, but this is not so. Special relativity explains this using the axiom that speed of light is invariant in all reference frames, and its mathematical formulation is the fairly simple Lorentz transformations.
The physics behind this lies in the structure of space time itself. Like the invariant in 3d space ( dx^2 + dy^2 + dz^2), the invariant for '4-d space time' is dr^2 - c^2*dt^2 (d stands for delta). This determines all the properties of space time. (The invariant is the space time interval).
We measure speed by measuring time intervals and space intervals (distance). If these measurements are absolute, in the sense that any observer would agree on their measurements, our day to day experience would be true. But it turns out that space and time is stretched and compressed as seen by observers in different frames of reference. How a person perceives it is determined by his frame of reference and it is a property of space time that different observers observe it differently. This difference in 'appearance' of space time to different observers is such that the speed at which light travels is the same for all observers.
I hope you got an idea how it works physically. But if you ask why the speed of light is constant for all, the modern view is that 'c' is actually a property of space time itself and mass-less particles happened to move at this velocity!