Typically it's a vent to the outside. I wouldn't rely on it for smoking out your bathroom, as there have been many times where I've smoked out my bathroom and it's reaked for a good 1/2 day.
if you're in a house and the house is decently built, the fan should go all the way up and out of the roof. but stormyy's right about most of them going nowhere. my bathroom fan just blows right into the attic.
Turn on teh shower hot if your smokin in teh bathroom, and try to smoke out the window. Out of window (if possible or applicable) + Lots of steam + Fan = very low chance of retaining smell