High-interest debt — credit cards especially — is compounding in reverse. The same force that grows your investments works against you when you owe at 20%+, and it works faster than almost any investment grows. Carrying a balance means you're paying to have spent money you didn't have, and the interest quietly stacks on top of interest until the original purchase is a distant memory.
Because the interest rate is high and it compounds. At around 22%, a balance can balloon even if you never spend another dime, since each month's interest gets added to the pile that next month's interest is calculated on. It's the same snowball as investing — just rolling downhill at you.
Generally, paying off high-interest debt is a guaranteed return equal to the interest rate — and beating a guaranteed 20% by investing is nearly impossible. After capturing any employer match, wiping out high-interest debt usually comes before investing the rest.
Stop adding to it, then attack the balances — either highest interest rate first (saves the most money) or smallest balance first (builds momentum). Both work; the one you'll actually stick with is the right one.