To add, I'm pretty sure ransomware groups provide tips on how to beef up security and how they got hacked in the first place.
Like dentistry, you can pay a little upfront for a better toothbrush or you can pay the dentist way more to repair your teeth later on.