The Demoman is equipped with a rocket launcher.This type of enemy is capable of delivering heavy damage at once. Generally Demomen take position on high grounds and have very slow rate of fire. At long ranges, the Demomen use a rocket launcher but if a player approches them, they take out a pistol, just like the Sniper.
They are able to foresee your movements, therefore they will shoot at the position they think you will be, instead of the position you were when they shot.
Tactics
They have high damage, and can kill you if you have no armor points. They have a slow rate of fire, so they must be eliminated before they are able to cause heavy damage on the team.
The use of Snipers is recommended for eliminating them, and Vests with anti-explosive properties are recommended to reduce the damage from their Rockets.