Q is a confusing letter. We use it when we want to make the “kw” sound, in which case it’s always paired with u, or in the transliteration of a foreign word. It’s really a kind of useless letter since we have perfectly good letters to make any sound it makes. But it has survived, where letters like thorn and eth have not.
If you look at the alphabet gif, you’ll see that Q looked more like a circle on top of a stick back in early Latin. It got that symbol from Etruscan, a language from a region now part of Italy, and the ones that would pass on the alphabet to the Romans (and thus, the rest of Europe). Their alphabet derived from that of the Euboan Greeks that traveled to Italy. Q was the letter “qoppa” in Greek, the symbol for it pretty much the same circle-stick thing. It disappeared from use, probably because they had kappa.
Now, the Greek alphabet was created from the Phoenician alphabet sometime around the ninth century BCE. Q was part of the Phoenician alphabet, where q was called qoph, where the symbol appeared as a circle with a line running all the way down. Before that was proto Sinaitic, an abjad (consonant alphabet) that developed somewhere around 1800 BCE—almost four thousand years ago. Q was called qoph (the ph was like in phone, but rather p with a soft sound at the end, making it more like qoppa) and it was represented by a symbol that looks like a figure 8. K also existed in this form, so I’m not sure how Q was used differently from that, except as “kw”.
TL;DR: Q has always been a redundant letter, but no one but the Greeks stopped using it.