This is more or less what the question is after. Essentially, whichever atomic orbitals the molecular orbital is closer in energy to contribute proportionally more "character" to that molecular orbital. As a result, electrons in that molecular orbital spend more time in proximity of the atom whose atomic orbitals contribute the most character. In the extreme limit that the "molecular orbital" has the exact same energy as one of the atomic orbitals, then this means that the atomic orbital is essentially nonbonding.
In the case of cyanide, the bonding orbital has more nitrogen character than carbon character, for the reason you have stated, and so electrons spend more time close to nitrogen.