According to D&D lore.. and rules since D&D 1... Barbarians were a general term for anyone who was not formally taught how to fight, but relied on their brute force, raw strength and power of anger to drive them in battle. More brawn over brains approach to fighting.
While Fighters were trained warriors, think... Men-at-arms, knights, samurai, gladiators, and even Spartans.
While rangers were more along the lines of scouts, archers, hunters, raiders. They were often long range and speed over armor mentality.