The best way to prevent that is not to create the target in the first place. Scattered data is too much work to gather enough to have any value. So for instance, instead of piling up medical records like a giant pile of treasure just waiting for a pirate, disperse each to its owner.
Another option, especially for sensitive data, is Secure On Paper Only. In fact, ribbon typewriters are reviving because they cannot be hacked.
So when you see a data breach, think of it as a sign that people can't be arsed to protect the information. There are ways. But the ways take more work, so people prefer to make targets and just hope they don't get hit.