It's not exactly 98% of the profits; but, it still seems egregious.
From what I've noticed, royalties are generally about 10% of gross against advances (if any), or $1 on a $10 soft-cover. The publisher spends money on the acquisition, editing, printing, and distribution; in brick-and-morter land, this isn't cheap. Remember that the store needs to make a couple of bucks, too.
Additionally, major retailers include a buyback clause—if the book doesn't sell, the retailer can sell up to something like 15% of the initial purchase order back to the publisher. The publisher often forwards your share of that burden into your royalty payment schedule.
Though, ultimately, while authors might get screwed financially in a lot of ways, publishing does, as a consumer, keep a lot of crap out of your purchasing decisions. Publishers (on the whole) do provide a lot of value to you: are you going to buy Gruen's AWESOME guide to Ruby or The Ruby Programming Language from O'Reilly Publishing with its venerable woodcut cover treatment?
If you're trying to get your work out there (which is why people write in the first place) you're probably willing to take the traditional publishing deal.