People compare the taste of root beer to toothpaste because they both contain Wintergreen, which is widely used in the production of various products. Some toothpaste brands happen to use it, so these pastes have almost the same taste as root beer, though the overall formulation may vary.