It really depends on what breed and how they were raised. In the Alps, there are almost anually reports of wanderers being attacked or even killed by cows. They often are with their calves for a longer time, are less accustomed to (strange) people and usually a fully intact male is in the heard that can get really protective.
Approach them with caution, watch their behaviour closely and use common sense. That’s what I do and for me that works.
Well, then you were lucky. I‘ve been hiking off the beaten paths and more than once forced me an agitated bull to detour as he would not let me near his herd.