Opinions of knowledgeable people are all over the map on this.
It seems to depend on post depth, clay soil or not, freeze/thaw cycles or not, whether you are trying to contain large animals or not, yearly rainfall totals, local wind speeds, and what the local building codes say.
Civil engineering books must give some consistently reliable ways for doing fences - or not.