One of the major determinations in the displacement of hydrogen by chlorine is electronegativity for covalent bonding (as in the alkyl) and electron affinity in the case of ionic bonding. (as in the case of NaCl) Electronegativity and electron affinity are very similiar, they quantify the amount of attraction an element has for electrons, either covalently or ionically shared. Chlorine has one of the greatest magnitudes for both of these values (I use magnitude because electron affinity is generally a negative value with the lower number implying stronger attraction.) The electron affinity for Chlorine comes in at -348.6 KJ/mol and the electronegativity is 3.0 (the highest being Fluorine at 4.0) The other consideration is Ionization Energy, the energy required to remove an electron from an atom, this value is very high for Chlorine, meaning that it does not tend to lose electrons. However, this value is extremely low for sodium
The units of KJ/mol should help clarify the meaning of the value, it is a measure of the energy released when a chlorine atom gains an electron in an ionic bond. Electronegativity isn't as simple, but it has a similiar relationship to energy and covalent bonding. So we bust out with our Gibb's Free Energy (DeltaG = DeltaH - T*DeltaS) DeltaG is the change in free energy, DeltaH is the enthalpy of reaction, T is temperature and DeltaSis the change in entropy. For a reaction to occur spontaneously DeltaG must be a negative value. So we look at the partial reactions that occur for the neutralization:
HCl ionizes to H+ and Cl-: The DeltaH here is a positive value, it takes energy to break bonds, however the DeltaS is positive since twice as many particles are produced increasing the entropy significantly. So we see for a high enough temperature HCl will ionize.
NaOH dissociates to Na+ and (OH)-: Again, DeltaH is positive here, and DeltaS is positive, same considerations as before.
H+ and OH- form H2O: DeltaH is negative here, the creation of these bonds releases energy as heat. DeltaS is a negative, this takes particles away, lowering the randomness in the system. So this will only occur for sufficiently low temperatures, in this case room temp is low enough. |T*DeltaS|<|DeltaH|
Na+ and Cl- forming NaCl: DeltaH is again negative here. DeltaS is also negative, theoretically for low enough temperatures this will occur. (though water will freeze before it does, even with the siginifcant freezing point depression form the ions.) But as noted Na and Cl tend to remain in solution, the entropy term is more than the energy can overcome at room temperature. This is mostly because Na and Cl combine in a very orderly lattice structure, which greatly decreases disorder in the system. If in solution the Na and Cl remain ionized, and it is only when the water is removed(by boiling or evaporation) that the change in entropy is overcome.
The considerations for the alkyl reaction are much the same, but the reason for the displacement is the high elctronegativity of chlorine compared to Hydrogen, which means it more readily bonds, and releases energy in the process. Furthermore, because there are the same number of particles on either side of the equation the change in entropy is negligible overall.