If the owner doesn’t live nearby, or you don’t know who owns the animal, then you must take care of it. It should stay with you until your fellow Israelite comes looking for it, at which point you must return it to him.