In the present study, the acid–base behavior of compounds constituting the headgroups of biomembranes, O-phosphorylethanolamine (PEA), and O-phosphorylcholine (PPC) was investigated by potentiometric titrations in NaCl aqueous solutions at different temperatures (15 ≤ t/°C ≤ 37) and ionic strength (0.15 ≤ I/mol L−1 ≤ 1) values. The complexation properties and the speciation of these ligands with Mg2+ were defined under different temperatures (15 ≤ t/°C ≤ 37) and I = 0.15 mol L−1. The results evidenced the formation of three species for PEA, namely, MLH2, MLH, and ML and two species for PPC, namely, MLH and ML. 1H-NMR titrations were performed on solutions containing ligand and metal–ligand solutions at t = 25°C and I = 0.15 mol L−1. The estimated values of ligand protonation and complex formation constants and the speciation model are in accordance with the potentiometric data. The enthalpy changes were also determined at t = 25°C and I = 0.15 mol L−1 by the dependence of formation constants on the temperature, confirming the electrostatic nature of the interactions. Matrix-assisted laser desorption mass spectrometry (MALDI-MS) was applied for the characterization of Mg2+-L systems (L = PEA or PCC). MS/MS spectra of free ligands and of Mg2+-L species were obtained. The observed fragmentation patterns of both Mg2+-L systems allowed elucidating the interaction mechanism that occurs via the phosphate group generating a four-membered cycle.