Look at figure 1. The railroad cars in the "Input track" is not sorted. We need them in a sorted way in "Output track" like cars in figure2.
There are three holding tracks we can use to rearranging roailroad cars. A picture is worth than a thousand words, so look at the gif picture below. You can see how the process acts.
So, how we use