OEtmD says explain was “originally explane, spelling altered by influence of plain”.¹
There have been many different ways that English words have been spelled to indicate pronunciation. The word plain, for example, has been spelled plain, plane, plaine, playn, playne, pleyn, plegn, and plen.²
Over time, spelling has become more consistent: for example, we use plain and plane, and have stopped using the others. But spelling has not been regularized to the point where every similar word uses the same spelling rule to indicate pronunciation.
There is not really a particular reason why we ended up with a particular spelling: or, rather, the reason is simply that the language evolved to be so.