As you can see from your weapons’ stat screen, each is ranked for its effectiveness against a particular kind of enemy—the OD, the Scabs, Fizzco’s mechanized security forces, or big walls of meat like Herkers or Spawners—on a scale of one to four stars.
As a rule, a three-star rank means that a weapon inflicts its full damage to an enemy that belongs to that category. A lower rank means the weapon incurs a damage penalty when it hits an enemy in that category. As a guideline, a weapon with a two-star rank inflicts half damage to that type of enemy, and a weapon with a one-star rank inflicts a quarter of its usual damage.
This damage reduction does not necessarily affect any secondary effects that the weapon might have. For example, the Dirty Harry does half damage to robots, but if you shoot a Fizzco Rifle Bot with it, it still knocks the robot over.
A weapon with a four-star rank against a given type of enemy receives a multiplier to its base damage. This differs from case to case, but can be anywhere from 125% to 200%.