A chimney flue is a chamber where smoke, hot gases, and other byproducts of fire are vented. Its purpose is to provide a vent with minimal heat loss so that those byproducts do not back up into a room and endanger people (or animals) living inside. The amount of draft can be controlled with the use of a damper which is mounted inside the chimney flue and allows the user to strike the perfect balance between ventilation and heat loss.
Over time the chimney flue will be covered with creosote and other byproducts of combustion which can pose a fire hazard and be very dangerous. Due to this it is extremely important that the chimney get inspected and cleaned regularly to remove buildup and reduce the risk of fires. As flues age, they can break down requiring repair or replacement. A professional chimney sweep could tell you whether a flue needs cleaning or not, or whether it needs replacement.