Molasses is a simple sugar and a carbohydrate booster for your plant. (Your plant naturally produces carbohydrates by photosynthesis, for energy to carry out biological tasks.) It also feeds the colonies of beneficial micro-organisms living in your root zone (Trichoderma bacteria, mycorrhizal fungi, etc). Thats why it works.
In practice, a plant receiving molasses with every watering during the flowering stage will produce, on average, 15% more dry weight than an identical plant without molasses (Source: Jorge Cervantes). Some people also believe it affects the bouquet, aroma, and flavor of the buds.
Search the forums for 'molasses' and you will find plenty of threads about it,