What relationship keeps predators away from acacia tree and in turn provides shelter and food for ants

The relationship is mutualistic. The acacia tree provides shelter and food for ants in specialized structures called "domatia" and "extrafloral nectaries". In turn, the ants protect the tree from predators, herbivores and competing plants by aggressively attacking them. The ants also keep the area around the tree clean and free of debris, which benefits the tree. This relationship is an example of mutualism because both the tree and the ants benefit from each other's presence and actions.