Nicotine acts in the former manner, e.g., by mimicking a naturally occurring substance in the body.
So, first we will discuss what acetylcholine does and then how nicotine mimicks it. We biologists being literalists refer to the receptors which recognize ACh as acetylcholine receptors or AChRs. Now if you are thinking about your house's wiring, when ions flow, there is an electrical current, and the same is true in the nervous system. The most studied nAChRs are in fact those on the muscles, because those receptors are what cause the muscle to get excited and contract. If you dissect out a muscle, and you apply nicotine to it, the muscle will still contract.