Recording has changed dramatically over the decades and centuries.
Originally if you were to record a piece of music it would be written out on a sheet of music. Then things progressed and people were able to record onto vinyl, where a needle would etch in the waveform into a circular dick of plastic that would be played on a record player.
Then tape was developed and you could record onto that. Tape works by magnetic dust in the tape strip that after you record through a tape machine would put in the waveform by moving the magnetic strip of tape around the spindle.
Then DAWs were invented (Digital Audio Wavestation) and people could record and save and edit on computers. When recording you would record using an audio interface or 'sound card', this converts the analog signal of your microphone or guitar and changes it into a digital signal. You can achieve a thing called 'sequencing' in a DAW which is layering instruments and effects, this is also called multi-tracking. You can also make loops, all these thing dramatically make the entire recording process a lot easier.