How did "to draw" shift to mean "to depict with lines"?
"To draw" originally meant "to drag, pull", and it's pretty easy to make sense of the many meanings of the verb with that in mind.
Draw a sword, draw a card, draw water from a well, draw breath, a drawer, withdraw, ...
Even for the most farfetched ones, I can see the figurative stretch. But not for the main meaning of the verb.
What does "to produce artwork" have to do with pulling or dragging?
btw I'm not sure if I cann technically call it a semantic shift if the original meaning is still in use.
Emerging ca. 1200, draw in the graphic sense comes from drawing some implement or material — pen, pencil, chalk, etc. — across an appropriate surface:
Draw thanne by thi rewle a lyne fro the hed of aries to the hed of libra.— Equatorie of the Planets, Ms. Cambridge, Peterhouse 75, ca. 1392.
(A rough translation into modern English, from the comments: "Draw then using your ruler a line from the head of Aries to the head of Libra.")
There is not really a significant semantic shift, given that to produce a "drawing" one must still drag/pull the pen/pencil/chalk across a surface. The real issue is the appropriating of physical metaphors[1] for digital artifacts (window/file/folder/drawing)[2]. This also occurs when referring to digital representations as their physical counterpart (such as when a user might say they are "viewing the drawings of DaVinci" online, when they are, in fact, viewing digital representations of photos of the drawings). This has led to any type of visual representation in digital form to be referred to as if it were the original, physical thing itself, such as when a program that produces a visual output consisting of lines is referred to as a "drawing". This is not specific to "draw", but occurs across a wide range of terms.[3]
[1]: https://core.ac.uk/download/pdf/155776687.pdf see chapter 2.2
[2]:https://lib.dr.iastate.edu/cgi/viewcontent.cgi?referer=https://www.google.com/&httpsredir=1&article=17685&context=rtd see chapter 1.2
[3]: http://prior.sigchi.org/chi95/Electronic/documnts/tutors/ams_bdy.htm see the lists of terms