It has several properties. It's both a stimulant and a relaxant. It helps you focus without burning out your neurons and inducing psychosis like amphetamines.
https://en.wikipedia.org/wiki/Nicotine#Psychoactive_effects
https://en.wikipedia.org/wiki/Nicotine#Enhancing_performance
While there is some risk to it, the actual danger (cancer, heart attack, stroke) from smoking is due to the tar content and other products of combustion from burning tobacco. While nicotine doesn't help blood pressure, it's not the killer that smoking is. It's also somewhat carcinogenic -- again, not as much as tobacco smoke and tar itself. You can find 80 and 90 year old smoking, but you can't really find elderly using cocaine, for example. As far as drugs go, it's relatively safe, for the benefits that it provides.
Also, there are several MAOIs in tobacco smoke. MAOIs are used as last-line anti-depressants, because of their side-effects when taken in large doses. But with tobacco products, a user basically gets a tritrateable MAOI.
If we suddenly discovered nicotine today, I'm convinced that either it or a close chemical cousin would be a the next miracle drug for anxiety and depression.
Perhaps there is a molecular relative of nicotine that could be employed as such, perhaps with less side-effects.