It helps them save energy. If they know that an animal poses no danger, then they don't waste energy fleeing from that animal constantly and instead can devote their time to feeding and doing other things they need to do. OTOH, it can cost them if an animal they are habituated to suddenly turns dangerous.
Hope this helps! Can I get a brainliest? I need it BADLY!