From the words themselves art seems to stem from the Latin word for "skill" and is usually used when referring to things that are not naturally occurring, but which require skill to produce. Words like artifact or artificial come to mind, which describe that something is human made and not just a result of nature. Which is sometimes used with a positive connotation like despite humans being part of nature we like to separate our accomplishments from pure entropy while in terms of unnatural waste could or cheap copies of natural processes could also have a negative connotation.
Craft on the other hand seems to stem from the German word "Kraft" which technically just means "physical strength". Which in a broader context could also describe power, energy and a general capability to do something. Which brings it back to also having a synonymous usage to "skill", making "craft" and "art" closely related.
My guess as to where that distinction is coming from would probably go to the industrial revolution, the ease of reproduction and the obsolescence of skill in the production process.
Like unless you are a poet or a singer, your skill likely also had a physical component and your product likely had a purpose and even if that purpose was just to impress people and serve as a status symbol. So for all intents and purposes the difference between an artist and an artisan (craftsman) likely weren't even all that big in a practical sense. They both likely produced single unique pieces from start to finish, which had a practical purpose and the quality of their product would correspond to their skill and time invested. And maybe even both as a contractual work as well as on hold.
Now contrast that in the first iteration with "manufacturing" (which technically only means "hand made"), but which I use in the sense of "algorithmic production" in bigger workshops. Where you aim to produce "the same" or at least a very similar item time and time again and where every worker just does one step of it over and over again. That allows for parallelizing the production process, reducing the production time and increasing the output. But that also means that the uniqueness is gone, the skill required is diminished, the market gets saturated, the functionality is cheaper, the quality is more equal, the price per piece is lower.
So independent craftsmen are largely pushed out of business, because products with similar quality or even slightly lower or higher than that are cheaper and more accessible. So in order to persist they either need to abandon their craft and become a worker or provide the designs for a workshop or sell to people so rich that the low quantity/high quality production still pays suffices to live.
Which might explain from the perspective of the artist a sense of pride and superiority over the regular craftsman (worker) who just do menial uncreative "craft" while they produce ART. Or likewise for the consumer the uniqueness that previously was the norm, where only quality and functionality (often the same thing) mattered, now could have become a status symbol of its own. Like if everyone is wearing the same branded stuff having something custom made is a luxury. So if the quality and functionality is largely the same, the design itself becomes a selling point.
And in the second iteration with the mechanization of the production process. Which further reduced the required skill, the price, the level of independent artists and increased the output, quality and market saturation. Now even the design process might have been made an algorithm in order to keep continuity and brand recognition further reducing the necessity for skill.
So while the craftsman previously combined elements of aesthetics, functionality, operative skills, those things are nowadays split into different professions.
The functionality is largely envisioned by scientists and constructed by engineers, who's creations are artistic (in that they are skillful and novel), but who are only concerned with functionality. The actual production comes down to workers who's skills are mostly operational and who often lack any creative freedom to build skills. And the aesthetics is largely covered by artists/designers as the intrinsic aesthetic of and design of a machine is most often hidden from the world in a literal or figurative "black box".
So the aesthetic side of art is reduced from the skillful fusion of function and aesthetics to the decorative or on the other end to the explorative. Like how art in paintings apparently moved away from naturalism as nobody could compete with the naturalism of a photography to the exploration and evocation of emotions and stuff like that.
So art and craft might have actually been separated into different steps of the production as functionality and design which were previously inseparable are now almost completely separate from each other.