The Gemara in מסכת הרכות speaks of the subject of תשלומים. This refers to making up a missed Davening.
If one forgot to say Maariv, he can say two שמונה עשרה’s at Shacharit. If one forgot Shacharit, the same for Mincha. If one forgot Mincha, he can say two Shmone Esreis at Maariv, even though Maariv represents the start of a new day.
The Gemara makes a point of the difference between טעה and ביטל. The word טעה implies that he accidentally forgot to daven, he can make it up in the next prayer. However, ביטל refers to intentionally missing Davening. In this case, he may not make up for his error. This is the Halacha of תשלומים.