Facebook has obtained nearly $2 billion in legal judgments against spammers, the company revealed today. In its explainer on the fight against spam, Facebook says the lawsuits serve as a warning to “remind would-be offenders that we will fight back.”

Spam is only “worth it” to spammers if it’s profitable. As such, Facebook tries to make it difficult for spammers to make money by regularly tweaking its various automated and manual systems for stopping suspicious activity. These systems span various points of interaction on the site, the company says, including registration, friending, liking, and messaging.

Facebook explains further:

We write rules and use machine learning to catch suspicious behavior that sticks out. When we catch fraudulent activity, we work to counter and prevent it, including blocking accounts and removing fake likes all at once. As our tools have become more sophisticated, we’ve contributed some of our spam-fighting technology to the academic community as well, in hopes of helping other companies combat similar problems.

The legal attack is just another layer of the spam-fighting cake. The money generated is the icing on top.

Facebook is not the first company to succeed in reducing spam, and it’s certainly not the first to fail to eliminate it completely. As spammers increasingly work to do defeat filters, this is an ongoing battle. Nonetheless, knowing spammers are being hit where it hurts is something we can all enjoy.