Relative motion is all about motion in relation to a frame of reference. A frame of reference is the motion of an observer of the motion of an object. For example, you may be sitting by your window observing a taxi driving past your house. From your perspective, you are at rest and the taxi is moving. However, a passenger on the taxi would see you as moving.
An observer at a train station would see a fast train that does not stop at that station move past them at a speed of 250 mph. If the observer can see inside the train, a cup of coffee on a train table would be seen as moving at the same speed as the train. A passenger on the train, though, would perceive the same cup of coffee being at rest on the table.
If an observer can see a child throwing a ball to a friend in a moving train in the same direction as the speed of the train, it would seem that the ball is moving faster than the train, as the final speed of the ball would be the sum of the speed of the train and the speed that the child threw the ball at.
Let's make this clearer. Look at the diagram of a train floor and a ball. The speed of the ball with respect to the train is 5 m/s. The speed of the train with respect to the ground is 10 m/s, so if someone outside the train is watching the ball moving, they will see it moving at 15 m/s, which is the sum of the speed of the train and the speed of the ball (with respect to the train).
If the child throws the ball in the opposite direction, the observer would see the ball slowing down and maybe even move to the opposite direction, depending on the speed of the train and the speed the ball was thrown at. This is because speed is not only a number, but a vector, called velocity. A vector is represented by an arrow, the length of which indicates the size of the speed (e.g. 20 km/s), whereas the direction the arrow points towards indicates the direction of movement.
We will now explore relative motion further through the questions that follow.