I'm fairly certain it is the nicotine that does that. Nicotine has been sadly and falsely demonized because of its association with cigarettes, but the danger of cigarettes isn't in the nicotine, it's in all the other chemicals and in the combustion. By itself there's not even evidence that nicotine is addictive: its addictive potential seems to be a combination of its rapid delivery method via cigarettes (it's like a shot of adrenaline to your brain) as well as all the other chemicals that make it more addictive than it would otherwise be. By itself, nicotine is just a stimulant similar to caffeine and can actually have a protective effect on certain aspects of brain functioning.There was study that indicated that there was something in cigarette smoke (not the nicotine) which forestalls the onset of dementia in some folks. It would be the same chemical in smoking papers. But I haven't heard anything more about it, so maybe there were errors in the study.
Yeah, here's a link to an article on the research: Can nicotine protect the aging brain?