Well, actually it's a bit more complicated than this. Pets and NPCs are indeed handled differently.
If a Pet kills a NPC exclusively, you won't get any kill credit, meaning you can't loot the NPC and you won't get any XP.
This means that pet owners have to tap the npc themselves, at least with 1 dmg. I guess they use this mechanics to ensure that pets won't be exploited as some kind of bot.
Something worth mentioning is that Totems count as Pets too!
Regarding NPC vs. NPC fights, its a bit different here.
You CAN get kill credit if you do enough damage to the NPC. Meaning: If two NPCs are already fighting, you can still get credit if health isn't below a certain value. I don't know the exact percentage, but it should be somewhere close to 50%(-10% ?). So if the NPC is untapped(meaning no other player has attacked it yet) and you deal at least 50% of the damage, the kill counts for you.
NPCs should NOT be lootable whatsoever if this condition isn't true.
I played a 70 hunter in BC and 80 mage in wotlk and I can confirm that these mechanics are still valid.
Would be nice if someone could confirm the percentage on NPC vs NPC fights.