They certainly do come from the same root; according to OED it is Latin explanare ‘make plain’. The spelling difference is due to the difference in vowel quality, which in turn is due to the position of the stress. That is, in ‘explain’, the stressed vowel is longer and came to be written ai to reflect that. Compare ‘detain’ vs. ‘detention’.
Which raises the issue of why we don’t write explanaition. My guess is that the nominalised verbs ending in -ion retained (and still retain) a latinate flavour and so kept their Latin spelling.