E. Cobham Brewer 18101897. Dictionary of Phrase and Fable. 1898.
Prim and precise order.
The origin of this phrase is still doubtful. Some suggest cap-à-pie, like a knight in complete armour. Some tell us that apples made into a pie are quartered and methodically arranged when the cores have been taken out. Perhaps the suggestion made above of nap-pe-pli (French, nappes pliées, folded linen, neat as folded linen, Latin, plico, to fold) is nearer the mark.
It has also been suggested that Apple-pie order may be a corruption of alpha, beta, meaning as orderly as the letters of the alphabet.
Everything being in apple-pie order, Dr. Johnson proposed that we should accompany him to MTassas kraal.Adventures in Mashonaland, p. 294 (1893).