Why does smoking change the human voice?
Smoke is hotter than air and passes through your vocal cords (before getting to your lungs), irritating them.
Irritation produces inflammation and inflammation produces mucus and general edema that could affect the biomechanics of your vocal cords, especially if you're a seasoned smoker.
The edema of the vocal cords is called Reinke's edema, which is classified as a benign polyp and will definetely make your voice more low-pitched.
I just saw that you added vaping in your question.
Since vape contains irritating chemicals too, I think its effects wouldn't be much better than smoke..obviously it depends on how often you smoke/vape.
Also, check this article:

Significant research has been conducted about the effect of cigarette smoking on the larynx and vocal cords. Several studies also suggest that exposure to electronic nicotine delivery systems can cause cellular hyperplasia (growth of cells) and metaplasia (change in cells) in mucosal lining in rats. It is theorized and likely that the same would occur in human tissue. Another experiment assessed the toxicity of vegetable glycerin, which is known to be harmless in liquid form. Its effects change in aerosol form. The experiment concluded that the substance led to squamous metaplasia of the epiglottis epithelium. Other research shows that nicotine in cigarettes is likely to lead to cancer, including in the mouth and larynx.
If the delicate lining of the vocal cords are exposed to hot, vaporized chemicals, the tissues are likely to undergo change and lose their ability to behave normally. This may produce hoarseness, loss of vocal range, voice fatigue, or vocal injury.

and finally:

These diseases and their effects on the voice can deeply affect singers and other people who use their voice for  a living. The only option to avoid these is to abstain from vaping completely.