What advantage do they have over chemical primers?
mechanical parts only move so fast, heat up and wear.
when you have a chain cannon rof 100 rnds per second, it gets intense.
a spark discharge solves a lot of kinetic issues with engineering the mechanism and its timing.
It completely eliminates the physics and durability considerations of firing pin design.
For chemical primers there is a non-trivial lag between the trigger breaking and the firing pin being accelerated to sufficient velocity such that it ignites the primer. The mechanics of maximizing acceleration of the firing pin is adversarial to durability, reliability, and precision in a number of respects. In automatic weapons it is made worse because the same physics must run in reverse to support the desired rate of fire.
With electronic primers, you mostly only need to worry about switching electric power fast enough (trivial). The relatively fragile firing pin mechanics don't need to exist. But you do need electronics, which has its own issues.