This arises from the Maxwell Equation. Because in any inertia reference frame, the maxwell equation indicates C (speed of light) is the same, (of course in vacuum). If we strongly believe in this and "constant speed of light"= distance/ time, we will have relative time because we do not agree on distance when in different reference frames. This is the origin. Just think about it more.

if two objects are moving in the same direction with the same velocity,a, their relative velocity is zero! if the two objects were moving in opposite directions with the same velocity,a, their relative velocity would be 2a!

according to einstein's theory of relativity, all inertial frames see the speed of light as the same i.e. 3x10^8 m/s, even if the two frames have some diff in their velocities they'd see a beam of light coming towards them at the same speed.this happens as no frame can be preferred over another frame.

relativity comes from the word relative.This means that the length,time and velocity are different according to any observer in their frame of reference.The length,time and velocity measured by an observer in stationary frame of reference are different from other observer in moving frame of reference.All come from Doppler effect.But Doppler effect only applicable for velocity very much lower than speed of light,299 792 458 m/s.Please watch this video in youtube.http://www.youtube.com/watch?v=wteiuxyqtoM

the theory of relativity stems from two postulates (assumptions) which are that light travles at a constant speed, C and that the laws of physics stay the same in all reference frames (from all points of view in any type of motion).
let us imagine then we have a clock comprising of two mirrors within which a beam of light bounces back and forth (a tick could be said to be the beam bouncing of a mirror). now let us imagine someone is holding the clock at that i am looking at them. if they start to run then from my reference frame the beam of light has to travel further (since it is both traveling side ways and vertically). however from the referance frame of the person with the clock the beam of light only travels vertically (since relative to him the clock is not moving).
now it seems logical that for both people the light will take the same time to bounce between the mirrors. this is not the case however as if it were the light would have to speed up in some way to allow it to cover a greater distance in the same time. therefore according to me (the person watching) the other person has slowed down! they have actually experienced less time than i have.
this is the interesting bit though. from the other postulate (that you cannot tell if you are in motion because there is no change in the laws of physics) that ffrom the other persons point of view he must not be able to tell he is moving. therefore the same thing must happen from his point of view (so that neither can tell who is moving) therefore from his point of view it is the person watching who nslows down.
the theory shows that there is no such thing as absolute time or space and that events can appear to happen in a different order to different people.
Sorry if that was a little rushed (you did ask though) if you want to understan it better i woulld suggest reading a book called 'why does E=mc^2' by prof brian cox. it explains it really clearly and simply.
p.s. that was only an explanation of special relativity explaining general relativity would take to long (its explained in that book).
hope this helpes