We report ab initio generalized valence bond and correlation-consistent configuration interaction studies of CO and NO interacting with Pd and Pt atoms. We find dramatically different bonding mechanisms for the two ligands, which are easily understood in terms of changes in the electronic structure of the metal and the ligand. CO bonds to both Pd and Pt by a sigma-donor/pi-back-bonding mechanism, yielding linear geometries. Our calculations predict that the ground (1-SIGMA+) state of PdCO is bound by 27 kcal/mol, while the ground (1-SIGMA+) state of PtCO is bound by only 18.5 kcal/mol. By contrast, PdNO and PtNO are both bent, with the dominant bonding involving a covalent sigma-bond between a singly occupied metal d-sigma orbital and the singly occupied NO 2-pi-* orbital. While the ground (2A') state of PtNO is strongly bound [D(e)(Pt-NO) approximately 20 kcal/mol], NO binds very weakly to Pd [D(e)(Pd-NO) less-than-or-equal-to 4 kcal/mol]. Linear excited states (2-SIGMA+ and 2II) of PtNO and PdNO are predicted to be only weakly bound or unbound. However, corresponding linear cationic states (1-SIGMA+ and 3II) are strongly bound, but the cationic bent (1A') states are still the ground states of PtNO+ and PdNO+. These stark contrasts, in which NO binds strongly to Pt but weakly to Pd while CO binds much more strongly to Pd, are due to the preference for closed-shell species to bind strongly to other closed-shell species (e.g., CO to Pd) and for radicals to bind strongly to other radicals (e.g., NO to Pt).