Behavioral targeting uses past audience data and behavior to display ads, while contextual targeting focuses on the content of the current webpage. Contextual targeting ensures that ads are relevant to what users are engaging with at that moment, based on the page's content.