The chemomechanical response of triphosphates (TPs) and zinc phosphates (ZPs) to changes in pressure $p$ and temperature $T$ is studied through first-principles molecular dynamics. The maximum values of$p(g20\phantom{\rule{0.3em}{0ex}}\mathrm{GPa})$ and $T(\ensuremath{\approx}1000\phantom{\rule{0.3em}{0ex}}\mathrm{K})$ are chosen to mimic roughly the extreme conditions to which phosphates may be exposed during their role as engine antiwear films. In all systems, atoms undergo pressure-induced changes in coordination number. Upon decompression, these chemical changes are partially reversible but nevertheless show strong hysteresis effects. This leads to significant energy dissipation, which contributes to the high friction coefficients of ZP antiwear pads. ZPs remain a covalently cross-linked network after decompression, while TPs revert to a disconnected state. The decompressed TPs have a larger bulk modulus $(\ensuremath{\approx}35\phantom{\rule{0.3em}{0ex}}\mathrm{GPa})$ than the uncompressed TPs $(\ensuremath{\approx}27\phantom{\rule{0.3em}{0ex}}\mathrm{GPa})$. This increase is due to symmetry-breaking proton transfer reactions, which are irreversible on the time scale of the simulation. Temperature has little effect on the results.