We present an analysis of the dispersion interaction energy and forces in density-functional theory from the point of view of the adiabatic connection between the Kohn-Sham non-interacting and fully interacting systems. Accurate coupled-cluster singles-doubles-perturbative-triples [CCSD(T)] densities are computed for the helium dimer and used to construct the exchange-correlation potential of Kohn-Sham theory, showing agreement with earlier results presented for the Hartree-Fock-Kohn-Sham method [M. Allen and D. J. Tozer, J. Chem. Phys. 117, 11113 (2002)]. The accuracy of the methodology utilized to determine these solutions is checked by calculation of the Hellmann-Feynman forces based on the Kohn-Sham densities, which are compared with analytic CCSD(T) forces. To ensure that this comparison is valid in a finite atomic-orbital basis set, we employ floating Gaussian basis functions throughout and all results are counterpoise corrected. The subtle charge-rearrangement effects associated with the dispersion interaction are highlighted as the origin of a large part of the dispersion force. To recover the exchange-correlation components of the interaction energy, adiabatic connections are constructed for the supermolecular system and for its constituent atoms; subtraction of the resulting adiabatic-connection curves followed by integration over the interaction strength recovers the exchange-correlation contribution relevant to the density-functional description of the dispersion interaction. The results emphasize the long-ranged, dynamically correlated nature of the dispersion interaction between closed-shell species. An alternative adiabatic-connection path is also explored, where the electronic interactions are introduced in a manner that emphasizes the range of the electronic interactions, highlighting their purely long-ranged nature, consistent with the success of range-separated hybrid approaches in this context.