Platforms build retargeting audiences from tracking tools such as the Meta Pixel, from people who engaged with content on the platform itself and from customer lists a brand uploads. A common approach shows different messages by stage: a helpful piece of content to people who watched a video, a testimonial to people who visited a pricing page and a reminder to people who left something in their basket.
Done badly, retargeting feels like being followed around the internet. Limiting how often each person sees an ad, excluding people who have already bought and refreshing the creative keep it useful rather than irritating. It also depends on consent: under GDPR and similar laws, many visitors can only be added to a retargeting audience if they agreed to tracking cookies.