The death penalty exists to put a tangible value on life and punish murderers. It is a social contract: If you kill an innocent person then you are not worthy of living. In effect, your actions in committing murder forfeit your life. Period.
Enforcement is the responsibility of the state. Who but the state can enforce such a social contract? We surely don’t want the family or mobs taking justice into their own hands. Thus it becomes the state’s responsibility to enforce the value of life by removing those who broke that contract and committed murder.
What about deterrent? With the death penalty the goal of deterrent is this: the one who murdered once will not be allowed to murder again. Simply put, he is deterred since he will not live another day to murder again.