I have a flock free-ranging dawn-dusk with foxes all around, and haven't lost anyone - even a chick - to a fox since 2020, while a neighbour with a fenced area loses some every year. The difference in our arrangements? I have 4 roos with 15 hens, raised within the flock and who work together to protect the hens. And mobile coops that I move frequently (foxes are suspicious of change). Here's a photo of them in close formation when they sensed danger, snapped through a window so apologies for the quality.
View attachment 3575365
(and the metal pole with fluttering fabric atop is a hawk deterrent, again easy to move around and change things up)