why do animals live in groups