Retargeting can be done differently with all kinds of approaches, but it's most often refers to display ads or banner ads, which are targeted at users who have interacted with your website
one way or another. Once a random user visits your website he clicks on a product or takes any other action that you want them to take, a cookie is set at his browser. This cookie holds certain data that can be used for future retargeting based on his interactions on the website. These banner ads are placed by third party services like Google Display Network allowing your display ads to appear on other sites that your potential customer usually visit.