How would one ship know that it has more missiles left than another ship?
They wouldn't.
Rather they'd simply take turns engaging. Every ship is "lined up" in a queue, and the ship occupying the front of the queue gets to shoot next.
Fire one round, back of the line. Fire 8 rounds, back of the line. You got to shoot, you go to the back of the line. If you have 4 ships, with 2 FC's each, and get 4 salvos to fire at, they'd each fire on one salvo with one of the FC's, then move to the back of the line, and the next ship would fire. Rather than have 2 ships fully spent and two idle that increment, you'd have 4 ships half spent.
It won't entirely "fix" imbalances, but it would fix having one ship sit there and completely deplete its stocks while the others twiddle their thumbs and watch it do all the work.
Your magazine levels would look like armor does after a nasty battle, some completely out, some with a few salvos left, maybe some with a lot left. But generally speaking, they'd all be spent and low when you ran out.
Do the ship computers talk to each other automatically or does it require the crew to communicate such decisions? Could networked combat groups be a new research tech and ship module?
It would essentially be crew/computers handling it as far as the lore goes. From a programming perspective, if it were me, it'd be the taskgroup object that handles the taskings, rather than ships trying to work it out amongst themselves.
I wouldn't be opposed to a dedicated component and/or research offering the capability. The fire controls are really a very small part of the combat systems on modern warships, so why not, seems a sensible addition.
And what if I want one ship to empty its magazines first, so that it can be detached and sent back for resupply, instead of all AMM escorts running dry at the same time?
The priority queue has you covered.
If it helps, think of the priorities as a form of "reload" on the firecontrols, which isn't based on time, but on waiting for their turn. Higher priorities then 'reload more quickly" than lower.
If you want everyone to take fair turns, keep the priorities equal. Then every ship will wait its turn to use an FC, and when it shoots, it moves to the back* of the queue and doesn't get tasked with firing again until everyone else ahead of it in line has fired. If everyone else is reloading, whatever ship is not reloading is going to get to shoot again even if it wasn't technically next.
* back of the queue depending on its own priority of course, so it might not be the back, but not the front of the queue either, it depends on the priority.
If you want one ship to fire more often, ensure its priority is higher than the others, either because you lowered theirs, or raised its. Higher priorities don't go to the very back of the line unless its a very short line, then sometimes they will, but not always. Its very dependent on the exact implementation of a priority queue as to exactly how it would behave, and how the weightings are applied, but its very possible to have priorities so much higher that you never leave the front of the queue at all, and are first up every single time, or so low you never get to the front and so never get to shoot.
So you raised its priority significantly. Now that ship is involved in every engagement it possibly can, and the only time another ship fires is if there were too many targets for that one ship to fire on them all in that increment.
The entire point of the priority queue was to provide a means that we players could have an aegis like warship, perhaps a newer model, or has more launchers, or deeper magazines, or some combination of, that takes over the bulk of missile defence, and any lesser missile defence ships in the task force go from active roles, to lest active or even idle until a saturation attack happens, just because they have lower priorities.
This could also be accomplished somewhat using the salvo qty/size controls. If one ship is configured to a lower threshold for salvo count, or missiles per salvo, it will still be firing when the other ships have decided they have depleted the salvos enough for PD to handle and stopped.
Coercing one ship to outwork the others is very possible with this system, and you'll never have to worry about accidentally forgetting to enable someones firecontrol when that overachiever leaves the taskgroup.
Any other concerns, or perhaps these aren't fully clarified yet? Seriously, bring it on, a good idea can take it, and i'd like to consider any flaws this has that I haven't thought of.
edit:
currently building a little priority queue firing order demo in python to give an interactive example. I'll be back.