If I give my ally multiple of the same type of gear, will it automatically equip the superiour equipment, or do I have to figure that out for myself, and only give it the best gear?
Allies attempt to equip what they feel is the best gear out of those you give them. If you give them something worse than what they are currently equipping on that slot, they'll just hold onto it. If you take equipment from them that they have alternate options for, they'll then switch to the next on they feel is best. The priority is usually based first on the actual equipment stats like DV/PV on armor, then rarity and amount of enchantments will figure in when they sorta compete.
You can, however, influence their weaponry. When handing an item that can be held in the hands, you can specify which slot (Shoot or Hand, and which hand in the case of Hand) the equipment should go in. They may still choose to keep their current weapon setup, at least if they have other immediate options (like, if you try to replace a sword with a weaker sword, they may just not switch armaments). The remaining slots, they'll just equip automatically on their own with no instruction.
For the most part, you can rely on your allies to not be dumb about equipment, but if you specifically want them to, say, gear up with this slightly-lower-stat-but-has-specific-resistances-I-need-you-to-have armor, then you'd have to snag their current equipment as well to force them to use it. Do note that engagement jewelry, whether or not you gave it to them, is of sentimental value and that your ally would rather eat that ring than let you get your grimy meathooks on it, so be mindful of this.