The earliest citation found for the expression "third time's a charm" comes from the US in The Weekly Sentinel, June 1912:
Presumably the third try is more likely to succeed than the previous two tries. Apparently, two tries is not enough - there's some sort of virtue in not giving up and quitting after trying twice. Four tries? Too much - like beating your head against a brick wall.
That Mrs. Martha Carliss evidently believes in peace and happiness in wedlock and that she probably thinks third time's a charm is shown by the fact that she was granted a license today to marry Andrew W. Mowery.
I'm going to find out today whether the third time's a charm for this second Soft Serve Sock. I ripped out the first try after a couple of inches of the instep after noticing an error that created a jog in the pattern. And yesterday I ripped out my second try, an almost entirely completed sock. A couple of stitches had dropped from the back end of the needle and laddered down several rows. Tiny needles + dark splitty yarn + traveling stitches = a disaster I couldn't fix. But I'm determined; I'll give it one more try before I put this project in a Time Out and knit a dishcloth instead.