In my opinion, the best garden defense is diversity. That is, to plant a variety of plants so if one plant succumbs to a threat, the others of a different type may survive. This has been particularly effective when it comes to bug defense. For example, beans in one part of my garden have mites but other distant bean plants developed no such problem. The same is true of the mysterious leaf hole phenomena that has eaten some of the cauliflower plants but has yet to spread to the others. It even helped with the two legged tomato raider who picked the really large tomatoes but left some of the smaller cherry tomatoes on the other side of the garden.
When it comes to theft, I tend to go for discouragement rather than overt defense. I have a saying. In any given Walmart parking lot, there is one car with a million dollars in the trunk and another with a body in the trunk. The only reason we don't know which is which is that nobody bothers to check.
Keeping that in mind, I find that defense through obscurity seems to work. My surface tomatoes were harvested but the tasty ground hugging cucumbers and underground radishes seemed to have survived intact. The lettuce, lacking any interesting fruit like features also survived.
Still, I realize that locks, doors and even barbed wire also have their place for stopping the larger pests. This chap has the look that is rather representative of the type I'm talking about. Since such zombie like beings can't be conveniently killed in our present legal system, I'm considering some non-lethal options. For the small ones, a sensible 6 foot fence to obscure garden goodies should be sufficient. For those who are ambitious enough to climb fences, some prickly rose bushes may discourage frequent repeat visits.