Relative motion can be explained like , imagine my height is 6 ft and your height if 5 ft if i ask u how much i am taller than u ?
u ill say 1 ft . what u actually did subtracted your height from mine . similarly what we do in relative motion .
car A and Car B moving with velocity 40 and 20