The original EDM process was invented in 1943 by two Russian scientists, Dr. B.R. Lazarenko and Dr. N.I. Lazarenko. However, it was only in 1969 that the first commercial numerically controlled EDM machine was released by a Swiss company called Agie and the process was only fully refined in the 1980s.
The process consists of removing material from a workpiece by means of electrical sparks. The object to be machined (in this case, the rifle barrel) is connected to a source of electricity (the barrel is the "workpiece electrode") and another electrode called the "tool electrode" is placed close to the spot to be machined. Both electrodes are immersed in a dielectric liquid (typically, oil or de-ionized water). When the two electrodes are brought close to each other, the intensity of the electric field becomes higher than what the dielectric medium can contain and hence it breaks down, allowing current to flow between two electrodes. The generated sparks end up melting and vaporizing tiny pieces off both electrodes. Then the current is stopped, the old dielectric liquid is flushed out and replaced with new liquid, which also removes the metal debris out of the way. Now the tool electrode is positioned on the new area to be machined and the process is repeated. The entire process is automated and the tool electrode is moved by means of a computer numerically controlled (CNC) machine.
The advantages of using EDM for rifling are that it can be used on very hard materials that are otherwise difficult to machine by other methods. It is also very precise and there is no tool pressure so the rifling is not distorted. There is no heat or stress developed in the barrel as a side-effect of this process and no burring, so there is less post machining after the rifling is done. Most manufacturers use EDM machines not only for the rifling, but also to manufacture other parts of the rifle, such as the action and the receiver.
The disadvantages of this approach are that it is a pretty slow process and also consumes a lot of electricity. An EDM machine is also relatively expensive to purchase, hence this process is used by high-end custom manufacturers.