You know, I played this game for more than 10k hours at this point. I still don't know how weapon group REALLY affect the AI. I just hit the auto group button every time
The AI uses the weapon groups the same way the player does! There are a few specific notes on its behavior though.
The AI can toggle weapon groups on and off autofire, and does so to manage flux. A group in autofire on an AI ship acts exactly the same as a group on autofire for the player ship: Guns fire at their own individual aimpoints (important for different projectile speeds) at the currently selected target if it is in arc/range, or at any available ship/fighter/missile if the target is not in arc or there is no target. AFAIK the AI prioritizes keeping weapon groups with PD online even at high flux, but will turn off other groups based in part on their flux consumption, starting with the higher flux groups. I don't think damage types play a role in this decision, but that comes into play later for manual groups.
The AI also selects a manual fire group, just like the player does, and aims all guns in that group at a single invisible cursor point. This is bad because guns of mixed velocities will have many misses. The AI then fires this group by 'clicking' fire, just like a player would. For
turrets this will only fire the weapons if the aim point is within arc of the turret. For hardpoints, it will fire the weapon on every click no matter what (this is the usual player manual fire group behavior). This is the source of the 'not firing in both directions' problems Null Ganymede mentions: if the weapons were on autofire they would be fine. But if the AI takes manual control then, just like the player, the guns on one side of a conquest will always be out of arc and not fire while the others are being clicked. In my opinion about 85% of 'wtf is the AI doing with its weapons?' moments come from it using a manually selected firing group the wrong way, and I've suggested in the past for the AI to never use manual control for anything but missiles (like many players do).
However, it turns out that the manual group selection is good for one thing: it is how the AI tries to tailor its offense vs the enemy defense. When the enemy has its shields up, it will try to select and fire kinetic weapons and fire them, and when the shield is down it will try to select and fire HE. I say 'try' to because the selection often gets stuck on missiles and doesn't work right. But it can still be worth it to have a kinetic group and an HE group if you want the AI to try and match its fire at the enemy by type. When high on flux, the AI often turns off all autofire except PD and uses one manual fire group for offense.
Some weapons, missiles especially, the AI will only ever fire from its manually selected group, and it often gets 'stuck' 'thinking' about firing them. It detects there is possibly an opportunity to do and then waits for the correct moment: but at the same time, its then not firing other manual fire only groups. This leads to having multiple weapon groups of missiles on a ship often not working correctly and seeming like they never fire.
The AI treats alternating and linked weapon groups exactly as the player does. This includes cycling to the next weapon every time an alternating group is selected, which leads to imbalances in missiles ammo reserves between different mounts when it does something like 'fire', 'select a different group','select missile group again' ending back on the first missile which has less ammo then the second.
So, as basic tips for weapon groups: group PD up together. Group weapons facing in the same direction together in case the AI manually selects them. Maybe group weapons by damage type, maybe not, depending on if you want the AI to fire them all together or try to detect whats best. Put all missiles in linked fire mode unless you have a very good reason not to.