In my particle physics lecture, ghost fields were briefly mentioned.
As far as I understand, these come up when computing cross sections by the path integral method, to compensate for equivalent contributions due to gauge freedom.
I'm still not sure how these equivalent contributions come up in the calculations. Say you want to compute the cross section of an electron anti-electron annihilation into a photon near a massive nucleus. I assume you would then take the sum of the path integrals over all possible Feynman diagrams corresponding to that interaction.
QED has charge symmetry (i.e. $U(1)$), so the physics stay the same if the two charges are swapped.
Where concretely do we have to introduce these ghost fields, and why can we not simply combine the Feynman diagrams that are graph-isomorphisms of each other into a single equivalence class and count the contribution of each equivalence class only once into the final probability amplitude.
Please keep the answers simple, as I'm not a physics major.