It is determined by the weapon itself. Every weapon has a strength and agility damage modifier.

For strength weapons, strength gets full bonus, agility gets 10% bonus.
For agility weapons, agility gets full bonus, strength gets 10% bonus.
Tools and focuses are balanced.
NPCWeapon includes all weapons used by pets. This is highly notable because it has a 0 modifier on agility. This means agility does nothing for pets. Even pets with ranged attacks still use NPCWeapon. Mounts are the only pets that get any benefit from agility, which is to make using a bow while mounted easier.
Thralls use normal weapons that you give to them, so they get the same bonuses players do. Their primary attribute gives full bonus, their secondary attribute gives 10%.