Anas b. Malik reported the Prophet ﷺ as saying: If any one forgets a prayer or oversleeps, he should observe it when he remembers it ; there is no expiation for it except that.
This hadith also teaches us about accountability and responsibility; even though Allah may forgive us for forgetting a prayer or oversleeping, He still expects us to take responsibility and make up for what was missed in order for us not only spiritually benefit from the act but also learn from our mistakes so that they are not repeated again in the future.