When you connect to a website with your browser, a connection to the websites' server/computer is established. As long as that connection remains established, what's called a "session" can be maintained. Cookies are used to continue a session after the connection has been severed.