They won't compete with each other because they may have different niches. For example, cows and dogs won't compete with their food since cows only eat grass, whereas dogs eat meat and vegetables but not raw grass.
I hope I was able to explain clearly. Have a good day.