Microscopic resolution of the interplay of Kondo screening and superconducting pairing