As late as the 1870s, sha'n't - with two separate apostrophes - was still in use in places, although versions of shan't appeared at least two centuries earlier. Given that the usual tendency in language is gradually to simplify things, the extra apostrophe was probably always doomed.
One variant of will, as far back as the 13th century, was spelt wo(l)le, which it still is in German. The negative would have been the two words wolle not. From that, it is easy to see how they were firstly telescoped into the single word, wonnot, and later abbreviated to won't.