No offense, but this question has been asked so many times now that you are much better off searching this forum for ‘recursion’ than waiting for someone to take the time to type up something again. Here are a few links to get you started:
Trying to understand why recursive code works
Recursion n-1 checking understanding