The shocklance, also called lance and SL, is a close-range energy-based weapon. It does not fire a projectile, but instead shocks your target with a bolt of electricity if you aim it successfully. If you miss your target, nothing happens other than the 'fire' sound effect. The shocklance has one of the slowest firing rates in the game - trumped only by the missile launcher - and has a range of between 14 and about 25 meters, depending on the mod. If you do not hit your target in the back, the shocklance does slightly less damage then a direct spinfusor shot. If you hit your target in the back, he will be killed instantly regardless of how much health he has or what armor he is wearing - unless he is wearing an activated shield pack. This is known as a backlance or less commonly a rearshot. This instant-kill property is the primary - and in some cases, the only - reason why the shocklance sees use.
Usage
The benefits of a shocklance depend entirely on what mod and what game type you are playing.
Base CTF, Siege, etc
In Base Capture the Flag, the shocklance was an incredibly useful weapon. It was without a doubt the best weapon for a defender to use when trying to stop incoming heavy offense, and was even rather easily used against cappers as well. The molasses-slow movement of base made it very easy to hit your target in the back with a shocklance by turning around as they flew past you. The slower you and your target are moving, the easier a lance shot is to hit.
In Base, pretty much any other game type that did not revolve around killing the enemy team, especially Siege, saw great use of the shocklance. Backlances are much more common in game types where there is another objective that might cause your target to pay less attention to you attacking him.
Even without backlancing, the shocklance still did a fair amount of damage to all armors. In Base, your target would be moving slow enough that you could often kill him without any backlances before he was able to go very far.
Classic CTF
In Classic CTF, the shocklance's use was greatly reduced. The introduction of mine-discing gave defenders a much more conveniently used way to deal high amounts of damage to incoming enemies. There were some players who refused to give up use of their shocklance, but a majority of them were far less useful players as a result of it. The speed of Classic made shocklancing harder and also made it more likely that by the time you could fire another shot (if you missed), it would be too late to stop the damage from being done. Having a shocklance in your loadout meant you were giving up that weapon slot for a weapon that can pretty much only be consistently used against slow-moving targets (pretty rare in Classic) who weren't paying any attention to you.
A few changes were made to the shocklance in Classic in an attempt to make it sightly more useful than a pellet gun, such as increasing the range by 2 meters, reducing the energy requirement, and increasing the kickback strength (to help combat the momentum of your target). Regardless, these changes didn't do much to keep the weapon in use.
Duel and Arena
For the most part, the shocklance shouldn't be used in Duel and Arena. The spinfusor, grenade launcher, chaingun and laser rifle are pretty much universally more effective than the shocklance. However, many players will use it simply because they believe it is more challenging. While it is possible for a crafty and skilled shocklancer to be effective in Arena, it's highly unlikely and was, for the most part, never seen in competition.
Misuse
Probably the most common reason for the continued use of the shocklance is that people believe it is difficult and makes them look skilled. What these people fail to realize is the difference between "difficult" and "useless". The shocklance is actually one of the easiest weapons in the game to hit your target with. The fact that it has no projectile and doesn't force you to spend too much thought on energy conservation are the two main factors that make it easier than other weapons. Contrary to popular belief, the fact that it takes so long to fire a second shot and the limited range do not add anything to the difficulty of using the weapon. Most of the time, getting in close to your opponent is not that tough of an accomplishment, and hitting your target at that range is by far easier to do with the shocklance than with any other weapon in the game. So, in fact, using the shocklance is not skillful at all. The issue is that it's not useful. The range and firing rate limitations of the shocklance exist solely to combat the ease of its use, and prevent the weapon from becoming unbalanced.
Players without sufficient understanding of the game will almost always miss the above facts, and frequently use the shocklance believing that it's a sign of skill. In reality, it's generally a sign of misunderstanding of gameplay. Though in their defense, in casual games, the shocklance can become much more effective because most of your opponents aren't going to be fighting in a very effective manner either. In these cases, the limitations of the shocklance won't prove to be enough to balance it against the possibly ineffective tactic your opponent will be trying to use. In other words, the shocklance can become very effective if you opponents aren't very good. In highly-competitive games, however, chances are you are only making yourself look bad by using a shocklance, not good. Occasionally, a nice play will be made with a shocklance that could not have been done with another weapon, but keep in mind, even a broken clock is right twice per day.