Retargeting in programmatic advertising involves showing digital ads to people who have previously shown interest in a similar product or brand. There are several tools and methods used for retargeting, including search retargeting which targets people based on searches for related keywords, contextual retargeting which uses behavioral segments to find likely customers, and site retargeting which re-engages users who left a site prematurely. Cross-device retargeting allows targeting of users across devices by mapping device IDs, while still considering other factors like brand safety, context, location, and frequency capping for best results.