Stainless steel was first introduced in RIFLE barrels around WW2 for commericial rifles when the first of the modern "varmint" cartridges came out. Rounds like the .22-250 were destroying traditional carbon steel barrels (from an accuracy standpoint) in as little as 500 rounds.
The failure mode on rifle barrels is erosion, which is basically flame cutting of the steel caused by the hot propellant gases. Stainless steel is MUCH more resistant to this action, hence it's popularity in varmint rifle barrels.
That said, it is harder to make a stainless rifle barrel of equivalent accuracy to that made with carbon steel. That is not to say that ALL stainless barrels are less accurate, merely that it's cheaper to do it with carbon steel.
All of this is pretty meaningless on pistol barrels. The temperature of the gases, and the duration of the burning, are so much shorter than in a rifle, that erosion is pretty much not an issue.
Stainless barrels, without stainless rest-of-the-gun, are a "what for?" on a pistol.