One of my players is a ranger and she is really, really into animals so every time I design an encounter with an animal as an enemy she automatically tries to tame it and make it a companion. As a result many of my encounters end up being far easier than they were meant to be and she now owns an absurd amount of powerful animals so the party has wound up looking like a deranged circus. I cant find anything in the rules to limit this. I've tried just saying no but this annoys her and brings down the mood, and throwing enemies at them to kill them off would be too malicious (She and I switch of DM-ing every now and again and if I kill to many of her companions she's likely to go after my familiar in the same fashion and I'd just rather not get into that situation). Is there something in the rules that can help me put a st to this? any solution welcome
Yeah, Handle Animal is Borked
You've accidentally run into something that Optimizers have intentionally used to break world optimization records.
Handle Animal has no real limit except the DCs required to train beasts, and finding some way to stop the beast from killing you in the meantime. With Charm Animal and the like, it becomes very possible for a low level druid or ranger to have a trained Dire Bear, which is, obviously, insane. Very good for versimilitude, though, as it decouples the normal 'level=power' aesthetic of DnD and makes things a bit more realistic and varied, but a bit of a nightmare for a GM.
My Fix: Logistics
No, really. Carting around a bunch of animals, some of which are meat-eaters, all of them used to having an area they hunt or graze instead of traveling, all of them requiring multiple uses of Teleport to shuttle around, all of them unable to get into cities, some of them getting sick, some of them picking fights with other animals, eating other trained animals, eating cart-horses, eating hirelings, getting jealous, getting into fights... real animal trainers only have a few properly trained animals at any one time, especially those that train them for combat (see: police dogs, police horses) or stressful activity (show dogs, trained animals for movie shoots). In some cases it can require multiple handlers for each high-performance animal (although she's probably not keeping them to that high a standard).
In any case, the upkeep for one ranger should be 'too high'. She should need, after you bring up various problems, cut her sleeping time and have her be fatigued from having to handle night emergencies, have her have to stay behind and look after a sick bear when the party really need her to leave right now, etc, to find some permanent place to keep the animals - with a nature-themed friendly npc, like a good farmer or trainer, a nymph or dryad, a druid in the forest - someone you've already introduced as one of the contacts story-linked to her character.
So invent problems with the animals. Have it take up screen time. It's a good sub-plot, and should be fun to run for both you and her.
My Fix: Smart Enemies
Animals are not as good as PCs. Sure, they have high str and high HD, but they don't have the defenses and immunities and strategies of Player Characters. Smart enemies are going to know this. Smart enemies are going to use this. Fire panics most creatures, and in their haste to escape they can and will cut through their own ranks, even attack the PCs.
Ray of Stupidity will knock a bear down for the count, and Chained Ray of Stupidity will knock out a whole room full of animals. Which your minions then Coup De Grace, to distract the PCs and force them to defend them. Mind Fog, Solid Fog, Glitterdust, Slow + Distractions, Silent Image, all kinds of other spells, all of them will smash bears and the like. Covered pits mean nothing to a Rogue, but to a charging wolf pack they spell doom. Archers up on ledges - PCs take cover or run away, but animals get pincushioned and panic and attack each other. Making a Handled Animal use a Trick is a Move Action - in a situation where you can't use existing commands like 'Guard' or 'Attack'but have to re-order your animal minions, that is a fatal, fatal flaw. They'll all be dead by the time you managed to get them in motion.
Man is the Apex predator of this world, and animals aren't. It's because Man can think around animals, use traps, tools, and in DnD, spells. A single powerful character with a high AC or trick like Large size + Reach Weapon + Improved Trip will run rings around animals - a prepared hordemaster enemy or a spellcaster will do the same. Allowing enemies to get approached and attacked by the animals should only work against mindless, low-int, or ambushed opponents. Even ambushed, opponents should try to get out of animal reach or use a spell to confuse them.
Poisoning, using commands against them, tripping, trapping, tricking, mind controlling, evil druids... even with a good wis score, animals don't have the int to deal with enemy plans, where PCs do. The only time animals are a threat is when the enemy doesn't have a plan. Like PCs dealing with typical 'closet troll' monsters, your NPCs need to trick, trap, and otherwise negate the animals without getting mauled in close range.
I'll stress - having NPCs take advantage of the animals in combat doesn't necessarily mean 'kill the animals'. Having them cause chaos and turn an easy fight into a tough, run-away battle is enough.
Narrative Framing - if you simply 'kill off' the ranger's animal friends, you'll definitely be in a bad place. Not only will you be ruining someone's fun, you'll be doing it for what seem to be metagame concerns rather than part of the game.
Ergo, don't. Make very sure that the party sees (illustrate through information - shouted commands during battle, scout finding the enemy preparations for pit traps and the like, a captured prisoner taunting the party that they may have defeated him, but at least those 'pesky animals' have been 'dealt with for good') very clearly that you are just trying to create enemies that are smart - have the smart enemies target other things, use other intelligent plans against individual PCs and their weaknesses - for bonus points, have some enemies of an organization get absolutely steamrolled by the Animal Horde, and later that same organization has a plan to deal with the animals when they show up again.
At worst, explicitly take aside the ranger player and explain that you're not targeting them specifically - that the animals are just easier for the enemies to hurt than the player characters, and so the enemies are doing that. Mention that it's the effectiveness of the animals in combat, and the Ranger's inventiveness in enlisting them, that has led to the enemies needing to specifically combat them - and that you wanted to give the player an interesting thing to roleplay, the interaction with the animals after they have specifically been in lots of danger or nearly died or died, and the ranger's reaction to that.
Spinning it to your advantage - Your player is close to and likes/loves these animals. Tragedy is a very strong story motivator. If you play this right, if you have the animals hurt or killed by an enemy, especially in a dastardly or cowardly way, if you make sure the players don't just think 'oh hey the DM finally killed off those animals that kept sweeping encounters', then it could become a really interesting story element. 'Revenge for my beautiful furry companions' is actually a really appropriate and fantastic ranger motivation.
Even better, the horror and chagrin the ranger could feel after all the animals get slaughtered or poisoned or whatever as revenge for them tearing the face off some enemy NPC who had buddies, could be a reason to avoid taking them into combat in the future. And if they continue to (which is fine, now that you have the tools to deal with it), it gives you more opportunity to tell that story about how having stuff you care about means you have to worry about it and try to protect it.
And storytelling is kind of the name of the game, after all.
There are a few things you're probably glossing over that should be making this circus-collecting way harder than it has been.
First, influencing an animal using Wild Empathy requires a whole minute of interaction and study, as this is the animal equivalent of Diplomacy. That can't normally be done during combat! (Incidentally, intelligent magical beasts inflict a penalty on the roll, making it less likely to work on them.)
Second, befriending an animal using Wild Empathy will not make them into an animal companion. A ranger gets one animal companion at a time (barring feats &c. to expand that). These other animals aren't Animal Companions, they're just friends of hers who happen to be of the furred persuasion. Just like most friends would quickly become non-friends if you asked them to help you move every day, these animal friends (not companions) will quickly leave if they're asked to risk life and limb every day.
On the other hand, if life is calm (read: non-adventurous) for long enough and she manages to keep these furry friends around long enough to use Handle Animal on them to domesticate them, then she could convert them from happy friends into disciplined, brainwashed slaves instead. Domesticating wild animals takes time though, and is required before they'll obey commands and be able to be taught tricks.
As they often say, there's no such thing as a free lunch. Stop giving your ranger a free lunch! When you take away the free lunch, though, you should probably do it as part of a sit-down conversation about how you've both been overlooking the rules, and it's breaking the game; otherwise, she's unlikely to be sympathetic to your lunch-revocation scheme.
Handle Animal doesn't allow a player to tame an animal in a few minutes and Handle Animal doesn't allow to get an Animal Companion at all.
To get an Animal Companion one has to use the Animal Companion (Ex) class feature in the druid or ranger class.
To tame an animal (not an Animal Companion) one has to use the Rear a Wild Animal action which is a particular action in the Handle Animal skill.
It will take some month to get a tamed animal (not an Animal Companion).
When the animal is reared / domesticated or during the rearing you have to "Teach" or "Train" it in order to "Handle" it more efficiently or one will only be able to "Push" it.
In conclusion, using "Handle Animal" to "tame" a "Companion Animal" is a multiple chained rule confusion.
How does she feed all the animals? Using something as simple as having to find food for them all could be one way of keeping their numbers in check.