Analog phonograph recordings predate commercial radio by more than two decades. The problem with early radio was that despite all the noise, it's audio was actually superior to that of the acoustic recordings of that era. Radio was also free. Recorded sound needed a way to compete with high quality free content. Bell Telephone Laboratories was established in 1925 and set to the task.
They were not alone in trying. In the UK, Lionel Guest and Horace O. Merriman had managed to jury-rig a set of four carbon microphones to a magnetic recording head. It was a genuine electrical recording. It just sounded pretty crappy and was considered inferior to acoustic recordings of the same era. They did record at least one record on Columbia using their method in 1920. It was a recording of a service at Westminster Abbey, their gear was set up in a truck outside. But the path to a superior electrical recording, the great-granddaddy of 'em all had started years earlier. Among those advances were the condenser microphone (1922), the vacuum tube (1857), matched impedance systems, and the recording head of course... putting it all together was no small feat. More here.
The final improvement was to improve the existing magnetic recording head technology. The existing acoustic methods relied upon the physical power of the sound wave. Here the condenser mic was used to receive that audio data, and convert it into electrical energy. The electromagnet-stylus assembly converted this back into movement. At the end the could produce a flat response from 250 Hz to about 15,000 Hz with this system. This "Western Electric electrical recording system" was branded as the "Westrex" system.