A CS2 StatTrak item carries a small counter on the weapon that ticks up with each kill you get while holding it. The counter resets to zero when the item changes hands, so a new owner always starts fresh. Music kits have a StatTrak version too, which counts MVP plays instead of kills.
StatTrak items come from cases and from trade-up contracts made entirely of StatTrak inputs. They cannot be added to a normal skin after the fact, and a StatTrak skin cannot be turned into a normal one.
How rare is StatTrak?
When a case drops a weapon skin, there is roughly a one in ten chance the item is StatTrak. That applies at every rarity, so a StatTrak Covert is about ten times rarer than a normal Covert. Knives and gloves from cases follow the same rule for knives; gloves do not come in StatTrak.
That scarcity is why StatTrak versions cost more, though the premium varies a lot. On cheap skins the gap may be a few cents. On popular rifles and knives it can be a large percentage of the price.
Does StatTrak affect trade-up contracts?
Yes. A trade-up must be all StatTrak or all normal. Ten StatTrak inputs give a StatTrak output, and you cannot mix even one normal skin into that contract. This makes StatTrak trade-ups a separate market with its own input prices and expected value.
StatTrak has no effect on gameplay beyond the counter. Some players value a high kill count on their own item, but it adds nothing at resale because the count resets. A seller who asks extra for a high counter is asking for a premium that vanishes on delivery.