The base is original from the producer (chords and melodies), but is complemented with elements that complement the song that come from samplepacks, usually, vocal chops, guitars, wobbles sections, glitch effects. It is the standard in which most of producers work, in a project you will find MIDI files made by the producer, but also melodic loops.
Process note
The idea of the guitar melody is based on a sample, but the guitar sounds 100% different from the original, it's a totally different creation. A different track.
Melodic loops
Instrument Guitar
Sample pack Splice - Hella Hits
Loop name OS_HH_150_D#m_License_Guitar_Melody