When you use a link shortener, the tool generates a unique, shorter URL that redirects to the original long URL. This is done by creating a unique identifier for the long URL and mapping this identifier to the original link in the tool's database. When users click on the shortened link, they are redirected to the original URL.