Activity must be balanced among all three areas to be effective. Prevention is the main defense. Alas, there is no panacea, no wall high enough, no moat deep enough. Your defenses may be finagled, end-run, or overcome by brute force. You will study and apply defenses step by step, based on your resources and analysis of risk, for all eternity.
Detection is the essential partner of defense.
No defense is perfect, even for a limited purpose. Your best hope is to stop damage as soon as possible and design new defenses based on the new knowledge. Recovery is the last defense. Once prevention has failed, preplanned and tested recovery methods are needed. Backups, spare parts and equipment, and a written plan are good starting places.