So the spell animal friendship makes sense. But the animal companion not so much. Your companion cannot attack on your turn unless you command and therefore, lose your own attack. How about a fighter who purchases a dog? That dog, as a companion to the fighter, can and will attack anything opposed to his master/pack-leader. That dog will have its own attacks regardless of the attacks of the fighter. So a ranger may be better off just buying a pet? Am I missing something here?