"Sampling" as term only became common in the '80s, but there's a long history of using prerecorded music as a songwriting tool.
Before the days of DAWs or easy-to-use samplers, musicians from The Beatles to Pink Floyd to Robert Fripp were stretching the limits of magnetic tape: splicing, repeating, or otherwise using small segments of pre-recorded sound to make music.
In this video, Fess Grandiose walks us through this past, when the composition methods from musique concrète first broke into pop.