Being able to rationalize and predict which metastable intermediates form during solid-state reactions is crucial towards developing computable frameworks for predictive synthesis. Using NaxMO2 layered oxides (M = Co, Mn) as an example we use in-situ experiments and ab-initio calculations to rationalize the complex pathway of stable and metastable phases that is observed to form along the pathway towards the final equilibrium state. We demonstrate that the presumed low temperature equilibrium states are actually metastable, and form as the result of a complex pathway that is set by the first phase that forms in the system. This phase seems to be selected by an optimization of Gibbs free energy, but under compositional constraint conditions which are different from the ones imposed on the overall reaction vessel. Remarkably, we find that we can predictively modify the reaction pathway, and therefore the metastable phases that form, simply by changing the precursor materials.