We present molecular dynamics simulations based on finite-temperature density functional theory that determine self-consistently the dynamic ion structure factor and the electronic form factor in lithium. Our comprehensive data set allows for the calculation of the dispersion relation for collective excitations, the calculation of the sound velocity, and the determination of the ion feature from the total electronic form factor and the ion structure factor. The results are compared with available experimental x-ray and neutron scattering data. Good agreement is found for both the liquid metal and warm dense matter domain. Finally, we study the impact of possible target inhomogeneities on x-ray scattering spectra.