The structure, phase stability, and mechanical properties of ternary alloys of the Zr-Ta-N system are investigated by combining thin-film growth and ab initio calculations. ${\mathrm{Zr}}_{1\ensuremath{-}x}{\mathrm{Ta}}_{x}\mathrm{N}$ films with $0\ensuremath{\le}x\ensuremath{\le}1$ were deposited by reactive magnetron cosputtering in $\mathrm{Ar}+{\mathrm{N}}_{2}$ plasma discharge and their structural properties characterized by x-ray diffraction. We considered both ordered and disordered alloys, using supercells and special quasirandom structure approaches, to account for different possible metal atom distributions on the cation sublattice. Density functional theory within the generalized gradient approximation was employed to calculate the electronic structure as well as predict the evolution of the lattice parameter and key mechanical properties, including single-crystal elastic constants and polycrystalline elastic moduli, of ternary ${\mathrm{Zr}}_{1\ensuremath{-}x}{\mathrm{Ta}}_{x}\mathrm{N}$ compounds with cubic rocksalt structure. These calculated values are compared with experimental data from thin-film measurements using Brillouin light scattering and nanoindentation tests. We also study the validity of Vegard's empirical rule and the effect of growth-dependent stresses on the lattice parameter. The thermal stability of these ${\mathrm{Zr}}_{1\ensuremath{-}x}{\mathrm{Ta}}_{x}\mathrm{N}$ films is also studied, based on their structural and mechanical response upon vacuum annealing at 850 \ifmmode^\circ\else\textdegree\fi{}C for 3 h. Our findings demonstrate that ${\mathrm{Zr}}_{1\ensuremath{-}x}{\mathrm{Ta}}_{x}\mathrm{N}$ alloys with Ta fraction $0.51\ensuremath{\leqslant}x\ensuremath{\leqslant}0.78$ exhibit enhanced toughness, while retaining high hardness \ensuremath{\sim}30 GPa, as a result of increased valence electron concentration and phase stability tuning. Calculations performed for disordered or ordered structures both lead to the same conclusion regarding the mechanical behavior of these nitride alloys, in agreement with recent literature findings [H. Kindlund, D. G. Sangiovanni, L. Martinez-de-Olcoz, J. Lu, J. Jensen, J. Birch, I. Petrov, J. E. Greene, V. Chirita, and L. Hultman, APL Materials 1, 042104 (2013)].