The presence of brittle Mg–Al intermetallic compounds (IMCs) in Mg/Al welded joints significantly degrades their mechanical properties. Understanding of the joint interfacial metallurgical reactions is essential for improving the performance of Mg/Al joints. Various single element interlayers, such as Ti, Ni, Zn, Fe, Ce and Cu, have been introduced to improve the joint performance, and the Miedema model has been applied to analyze the priority of phase generations in binary systems. However, the metallurgical reactions in the Mg/Al interface with bi-alloy interlayers cannot be fully explained using only a binary system. In this study, laser welding of AZ31-5A06 using a Ti–Ni interlayer was comprehensively investigated Then, the aggregation tendency of the elements in the Mg–Ni–Ti–Al system was explained using the Toop model and the ternary phase diagram was used to analyze the solidification process in the interlayer. With the increasing of laser power, the interlayer became from intact to incomplete, and finally completely destroyed. As a result, the Mg–Al IMCs with a thickness of 4.5 μm (1617 W) increased to 17–21 μm (1815 W) and 130 μm (2013 W) respectively. The distribution of Mg–Al IMCs also changed from being distributed between Mg-interlayer (1617 W) to being discontinuously distributed within the joint (1815 W) and continuously distributed within the joint (2013 W). When the interlayer remained intact at 1617 W, the maximum shear strength of the joint was 145.76 MPa, and the fracture exhibited a mixed fracture pattern consisting of brittle and ductile fracture. At 1617 W, the distribution of elements at the joint interface revealed that the interlayer was composed of Al, Ni, and Ti without Mg, which successfully blocked the diffusion between Mg and Al. The Gibbs free energy calculated from the Toop model indicated that the minimum Gibbs free energy of an Al–Ni–Ti system was −59.3 kJ/mol, which is lower than that of a Mg–Ni–Ti system (−48.1 kJ/mol); therefore, the Al–Ni–Ti system would be preferentially generated in the joint. The composition of the interlayer was mainly concentrated in the α-Ti and β-Ti phase region of the liquid-phase projection phase diagram and in the TiAl+τ3-Al3NiTi2 and Ti3Al+τ3-Al3NiTi2 phase regions of the isothermal cross-section phase diagram. Consequently, the interlayer consists of multiple phases such as Ti3Al, TiAl, and Al3NiTi2. The Ti3Al and TiAl with superior strength and deformability in the interlayer inhibited the generation of Mg–Al IMC, and the partially melted Ni layer facilitated the connection between Mg/Ni/Ti, thus improving the strength of Mg–Al dissimilar alloy joints.