Lobelia contains an alkaloid called lobeline which is very similar to nicotine and binds with the same receptors. This makes the cells happy so they stop screaming for a cigarette.
Have a look at this lesson for other herbs that help with addiction recovery starting with slide 11
Nervous System II: Issues & Interventions
Don't use herbs or combine herbs with medications or use them during lactation or pregnancy without talking with your healthcare provider.