RGP is the acronym for Redemption Grace Period and represents the period during which a registrant can apply to recover/retrieve a domain name after the domain name has been canceled. 
There are various reasons a domain may be deleted without the intention to do so by the registrant, most common are: Simply forgetting to renew, fraud by someone else, or an administrative mistake. ICANN developed the RGP in order to allow registrant one last chance to recover the name in these situations. 
The original registrant of the domain name is the only one allowed to retrieve it. Otherwise, no other registrants are allowed to register the domain name during the RGP. The redemption grace period lasts 30 days after the cancellation of the domain name by the registrar; see Domain Lifecycle.
Pending Delete Period
When the RGP expires there is then a 5-day period during which the domain name is pending for deletion. The 5-days period is also known as RHP (Redemption Holding Period) and during this period the domain names is locked. This period is the last notice/warning for registrants to correct their mistakes unless they prefer deletion of the domain name.
How does it work?
Instead of just deleting a name and returning it to the pool of domain names available for registration, the name goes into a 30-day grace period during which the original registrant can retrieve it by getting in touch with the domain registrar. If the RGP expires and the registrant fails to retrieve the domain during period, then it is deleted from the registry's database.
In order to retrieve the domain name during the 30 days RGP there is an addition fee which must be paid by the registrant. The redemption fees vary from time to time and are significantly higher than typical registration costs. 
During the RGP all websites and email services are stopped and nothing will work; this ensures that if a name is in use, it's owner is likely to notice it and therefore be less likely to lose it by accident. The users which need the domain name should make sure it does not enter in the RGP because additional costs are involved with the renewal of the registration.
A good way for a registrant to avoid high RGP costs is to stay on top of their domain name registrations and their expiration dates.