Consider two atoms at some distance $R$ from each other. The Hamiltonian of this system is then the sum of the Hamiltonians of the two atoms plus interaction terms involving the electrostatic interaction between the electrons of one atom with the electron and nucleus of the other atom. You can then calculate what the shift in the ground state energy of the system is due to the interaction term.
To first order in perturbation theory the shift is zero, there is nonzero shift at second order. This means that the effect is due to the interaction changing the wavefunction of the system which in turn has an effect on the energy. This gives you the force between the atoms. Due to conservation of energy, if the energy changes as a function of distance then the kinetic energy of free moving atoms will also have to change. Here you assume that the two atom system will remain in the instantaneous ground states, which is approximately correct for low velocities, this follows from the Adiabatic Theorem.
So, the total energy of atoms placed a distance $R$ from each other can be interpreted as an effective potential energy, the effective force is then minus the derivative of the effective potential energy.