What is the difference between a retributive view of punishment and a deterrence view of punishment?

https://plato.stanford.edu/entries/justice-retributive/

https://nij.gov/five-things/pages/deterrence.aspx