No they're just two different things. That's my point. On the one hand the state is delegated with using violence for protection. On the other hand the state is delegated with carrying out retribution.
If you had no state you would see people build the exact same delegations in private: first, people would enact their own protection and retribution; then, they would coordinate to make it more just by centralizing those powers and (theoretically) subordinating them to some system of justice that uses them more fairly than individuals would. We're just on the other side of that process, which is why I'm saying it's the explanation for why the state has those powers.
This has no bearing on the morality of "should the state do this"; it's just how it actually is, and why it makes sense of the minds of people who are okay with it (since the OP said they couldn't imagine a reason).
But, I think, if you aren't going to let the state carry out vengeance at all, you do need to figure out what you're going to do about people's desire for it to happen. (In practice though, you definitely are, you're just going to modulate how extreme it can be, i.e. killing people vs incarcerating them.) Just, IMO, the people who pretend like the justice system is not at all about retribution and only about rehabilitation/protection are... living in a fairy tale version of reality. Like I would love if that were the case, and if everyone was reformable and came out repentant for their behavior then it would be possible, but in practice, people want other people punished for their crimes. Consider that the point of jailing executives for fraud, which everyone wants more of, is not to prevent fraud but to actually punish them. Since it is the punishing that has a theoretical chance of stopping other people from fraud.