Display ads are generally targeted towards users based on their current context (contextual targeting), past behavior (behavioral targeting), or a combination of the two.
FORBES: How to Get That Diamond Ring on Your Anniversary! : Using First Party Data with Social Media for Display Ads.