Internal links help an user to navigate within the website and the external link helps the user as well as the performance of the website. Both links are used to rank higher in SERP.
This way of creating links is called link building, which is one of the techniques to improve website performance and to gain credibility.
The purpose of the internal links is to make the user spend more time on the website and to know more about the product or services it offers. However, External links take the user to other reputable websites.
Click the hyperlinks to test :)