Just to add to that both systems have a “spark gap” the more current you put through the greater the gap, the greater the speed but the worse the finishing. Consider the spark gap as an offset of the wire or electrode.
Spark erosion needs a sacrificial electrode and sometimes a number of them, especially if you have steep angle faces where a large spark gap on the sides takes more cleaning up than on the bottom face as you only travel in the Z-axis.
Wire erosion is programmed so needs no electrode (except the wire itself) and by second cutting or skim cutting tolerances of 0.0002” are easily achievable however you will end up with radii in the corners of about 0.006”.
So basically spark erosion is an alternative to CNC milling cavities, especially where corners are needed at depth.
Wire erosion is more accurate, but can only do through holes or profiles, not cavities, but also consider laser, plasma, or water jet cutting.