Why do triple bonds form?
All atoms want an fill valence shell, or octet.
Since all atoms want the feeling of having 8 electrons or being in the same state of a noble gas, they will interact and bond with other elements to do so. Sometimes a single, double, or triple bond is needed to transfer the electrons, for example, HCN.
You can see here that this covalent bond satisfies all atoms by sharing the electrons to obtain a full 8 or complete valence shell (2 electrons in the case of Hydrogen).
Hope this helps!