I believe the answer is: To help you remember and process information you have learned
REM cycles tend to start within 90 minutes after you fell asleep and would take up around 25% of your sleeping time.
During this period, a process that called as memorization session would occurs and this will help you to keep various information that you receive throughout the day in your long term memory.