It's usually roles for me. But there's more and more of those as time goes on, and sometimes something just catches my fancy, or there's a feature that's not on the gun I have now that I suddenly decide is important.
I started out looking for a carry gun and ended up with both a Kel-Tec P32 and a Kahr P9. The Kel-Tec was a pain to shoot, and only fed ball ammo. Plus it was a .32, and after an experience where I had a bullet stopped by a 2 x 4, I knew I needed a bigger pocket gun. The Kahr was easy to conceal, but like Kahr polymer guns occasionally do, it had reliability issues. Admittedly, I was still in the break-in period, but I think a gun should be reliable out of the box. Plus it was only a 9mm, and for a 9mm, it was really snappy. And the capacity was low.
The "Only a 9mm" thing really irked me, so my next carry gun was a .357 magnum SP101. Which was then TOO bulky, with the CT grips that grabbed my shirt and made it impossible to conceal.
Next gun was a S&W 642, which I still have and occasionally carry, because of the concealability issue. The 642 disappears, and I had good ammo for it, so I didn't feel as bad about the .38 thing.
But there was still the capacity thing... so now I have a full-size S&W M&P .40 cal.
But the M&P is a strict working gun, and gosh darn it, it's not that pretty... so now I want a Sig P229 or P228 user that I can make all pretty with new bluing and pretty grips and new sights...
You get the idea.