The performance of modern hard coating materials puts high demands on properties such as hardness, thermal stability and oxidation resistance. These properties not only depend on the chemical composition, but also on the structure of the material on a nanoscale. This kind of nanostructuring will change during use and can be both beneficial and detrimental as materials grown under non-equilibrium conditions transforms under heat treatment or pressure into other structures with significantly different properties. This thesis aims to reveal the physics behind the processes of phase stability and transformations and how this can be utilized to improve on the properties of this class of alloys. This has been achieved through the application of various methods of first-principles calculations and analysis of the results on the basis of thermodynamics and electronic structure theory.Within multicomponent transition metal aluminum nitride alloys (TMAlN) a number of studies have been carried out and presented here on ways of improving high temperature stability and hardness. Most (TMAl)N and TMN prefer a cubic B1 structure while AlN is stable in a hexagonal B4 phase, but for the purposes of hard coatings the metastable cubic B1 AlN phase, isostructural with the TMN phase is desired. It will be shown how the introduction of additional alloying components, such as Cr, into (TiAl)N changes the thermodynamic stability of phases so that new intermediary and metastable phases are formed during decomposition. In the case of such a (CrAl)N phase it is shown to have greater thermodynamic stability in the cubic phase than the pure AlN, resulting in improved high temperature hardness. Also, the importance of treating not just the binodal decomposition through the formation energy relative to end products but also the impact of spinodal decomposition from its second derivative due to the topology of formation energy surfaces is emphasized in the thesis. The impact of pressure on the AlN phase has also been studied through the calculation of a P-T diagram of AlN as part of a (TiAl)N alloy.During the study of chemical alloying of TM components into AlN the alloying of low concentrations of these TM were treated in great detail. What is generally referred to as the AlN phase in decomposition is not entirely pure and can be expected to contain traces of any alloying components, such as Ti and Cr or whatever other metals may be present. Low concentration alloying of Cr, on the order of 5-10% is also shown to be stable with regard to isostructural decomposition. Detailed analysis of the effect of Ti and Cr impurities in AlN has been carried out along with a systematic search of AlN alloyed with small amounts of other TM components. The impact of these impurities on the electronic structure and thermodynamic properties is analyzed and the general trends will be explained through the occupation of impurity states by d-like electrons.iv Theoretical treatment of such impurities is not straightforward however. AlN is an s-p semiconduct...