There are companies that support billions of economic output in countries which require a notice period. If they thought it was a risk that they would be taken down be a rogue employee, they have the option of putting them on 'gardening leave' during the notice period. This is extremely rare; they know the risk is insignificant so they are more keen to get any remaining value from the relationship (work, handover).
In our industry and many others, being a professional and maintaining good relations with your ex -colleagues, who form your professional network, is much more valuable than any emotional satisfaction from screwing them over, even without the risk of going to prison.