Several sites, some of which use cookies, visited several times. For each request, the browser looks in its cookie store: if it has a live cookie for that site it sends Cookie; if not, the server may answer with Set-Cookie. Follow the decision, the messages and the store.
Two headers with two roles: the cookie tells the server that it is the same browser (it joins the visits); Referer tells it which page each request came from (it names them). Without the cookie, two anonymous requests; without Referer, the same browser but unknown pages.