I can’t tell you how many people ask me this.
The smell is due to creosote (unburned smoke) deposits in the chimney, this is a natural byproduct of wood burning. The odor is usually worse in the summer when the humidity is high and the air conditioner is on. This moves the warm air outside. The warm air will try to get back in the house the easiest way.
You guessed it; right down the Chimney is easy way for air to get into the home.
The humidity compounds the problem because it causes the creosote to smell more than normal. A chimney cleaning or sweeping will help but usually won’t solve the smelly issue completely.
What can I do?
There are chimney deodorants that work remarkably well. Also, essential oil diffusers work well. I have talked to many people that have good results with baking soda in the fireplace.
The real problem is the air being drawn down the chimney; the reason being is overall pressure problems in the house. Some make-up air should be introduced somewhere else in the house. A flue top damper that is tight sealing will also reduce this air flow coming down the chimney.