Nucleophilicity - Basicity Relationships
What controls the selectivity between deprotonation (basicity) and carbonyl addition (nucleophilicity) of a donor?

This is complicated by the reversibility of sulfur, oxygen and some nitrogen nucleophilic attack at carbonyl, and reversibility of deprotonations by all weak bases.
Most of these considerations also apply to SN2 (Nu) vs E2 (base) reactivity