The Star of David came out of nowhere in the 17th century or so, from Eastern Europe. I know that much.
A derivation of the seal of Solomon was used for decorative and mystical purposes by Muslims and Kabbalistic Jews. The hexagram appears occasionally in Jewish contexts since antiquity as a decorative motif, such as a stone bearing a hexagram from the arch of the 3rd–4th century Khirbet Shura synagogue. A hexagram found in a religious context can be seen in a manuscript of the Hebrew Bible from 11th-century Cairo.
https://en.wikipedia.org/wiki/Star_of_David