You are entirely correct, you well need to replace the sprockets to stop this from happening.
What happens is the Chain and Sprockets wear out at the same rate, the rivets in the chain are worn down making the links longer, the sprocket teeth wear out to accomodate this, effectively making any new chain have links which are too short. If you find the old chain you will likely realise that you can move each link back and forth slightly. Only way to stop it is to replace the sprockets.
In my experience it can also happen if you have the chain too tight, but this should be less of an issue (if any at all) on casette gearing - almost everything I own uses hub gears - so that probably isn't it, it is just worth noting for future reference.
(I don't post here much if you haven't seen me around before, but when I signed up I said I would post any advice if I happened to be around and could help, so there you are, you are lucky