Collectible pins are pretty rare and valuable items. You get one after opening a pin capsule. The exact drop is random: the system selects one pin from a few variants included in the capsule.
The existence of CS2 pin capsules is very limited, which dictates their relatively high price. Like with skin cases, the investment can return the rarest items: CS2 pins of Extraordinary or Exotic levels.