c. 1400, "precisely, exactly;" late 15c., "fittingly, snugly;" c. 1500, "immediately;" from just (adj.) and paralleling the adverbial use of French juste (also compare Dutch juist, German just, from the adjectives).
The original sense of "exactly" in space, time, kind, or degree; "precisely, without interval, deviation, or variation" is preserved in just so "exactly that, in that very way" (1751), just as I thought, etc. But the sense decayed, as it often does in general words for exactness (compare anon, soon), from "exactly, precisely, punctually" to "within a little; with very little but a sufficient difference; nearly; almost exactly;" then by 1660s to "merely, barely, by or within a narrow margin (as in just missed). Hence just now as "a short time ago" (1680s). Also "very lately, within a brief period of time" (18c.). It is also used intensively, "quite" (by 1855).
Just-so story is attested 1902 in Kipling, from just so "exactly that, in that very way."