Each weapon has a specific range in which it operates best, and each category tends to specialize at a certain range.
Obvious examples are the lower accuracy but deadly damage from an up-close shotgun blast, versus the slow firing but lethal power of a long-range sniper rifle.
The key to using these tools is to get into an effective range to maximize its damage. Shooting from too far will result in minimal damage and simply alert the enemy to your location.
On the other hand, trying to get in really close can spoil a surprise attack or open you up to melee damage.
There is a fine balance to determine the best range but it ultimately comes down to choosing an assault location that gives you a clean line of sight, with as much cover as possible, while maximizing your range.
Shooting from the farthest effective range allows you to wipe out enemies from a distance that they might not be effective at.
The sort of exception to this rule is for a merc who has high stealth and mastery of melee weapons. Those few talented melee mercs can still utilize their range, which is up close, but they need to sneak or run in to close the distance.
Because squads are bound to have mixed weapons in their ranks, it can be an effective plan to draw out enemies with extended range while flanking or ambushing them with weapons that are lethal at mid or close range.
A quick way to gauge the effective range of a weapon is to use Command Mode to move the cursor over a foe and look at the chance to hit. This quick scan will display if the weapon is effective at that range.