This is a very formal term. You will almost never hear it in casual, everyday conversation. Its use is reserved for serious and official contexts.
Legal and Political Contexts: This is the most common usage. News reports, court documents, and government announcements will use this phrase when discussing the sentencing of criminals, especially in high-profile cases like corruption, economic fraud, or major crimes. The stated goal of the harsh sentence is to deter others.
Corporate and Business Settings: In a corporate environment, a manager might use this term in a formal report or meeting to explain why a severe action, like firing an employee for gross misconduct, was necessary. It signals that the company has a zero-tolerance policy.
Academic and Disciplinary Actions: A school or university might use this phrase to justify the expulsion of a student for a serious offense like academic fraud or cheating, framing it as a necessary measure to protect academic integrity.
Connotation: The connotation is always severe and negative for the person being punished. It implies a serious transgression and a harsh, public consequence. It is neutral from the perspective of the authority carrying out the punishment, as it is seen as a necessary function of governance.