Hidden Two-Step Phase Transition and Competing Reaction Pathways in LiFePO4