It is not odd at all and happens all the time.
Basically web sites keep track of when you visited, what you search for, how long you were on the site, what pages you visited and so on.
So they gradually build up a profile picture of you, so if you search a lot for say digital cameras they may surmise you want to buy a digital camera and are intertested in photography.
So your adverts will be targetted to digital cameras and so on.
One way they do this is to create a "cookie" on your PC when you visit a site and use the cookie to store information. Some of these cookies are known as "tracking cookies" because they track your web habits.
Cookies are also used to store things like your userid and password so you dont need to logon each time you visit a web site (like this one).
You can read a little about cookies here
http://www.bbc.co.uk/.../guides/about-cookies