Both SARS-CoV and SARS-CoV-2 bind to the human ACE2 receptor. Based on high-resolution structures, the two viruses bind in practically identical conformations, although several residues of the receptor-binding domain (RBD) differ between them. Here we have used molecular dynamics (MD) simulations, machine learning (ML), and free energy perturbation (FEP) calculations to elucidate the differences in RBD binding by the two viruses. Although only subtle differences were observed from the initial MD simulations of the two RBD-ACE2 complexes, ML identified the individual residues with the most distinctive ACE2 interactions, many of which have been highlighted in previous experimental studies. FEP calculations quantified the corresponding differences in binding free energies to ACE2, and examination of MD trajectories provided structural explanations for these differences. Lastly, the energetics of emerging SARS-CoV-2 mutations were studied, showing that the affinity of the RBD for ACE2 is increased by N501Y and E484K mutations but is slightly decreased by K417N.