How is IR spectroscopy used to determine the composition of asteroids? I am trying to understand how spectrometers or spectroscopy can be used to calculate the surface composition of asteroids for the purposes of asteroid mining.
It uses the same fundamental conept of mapping between emission-line wavelengths to certain transitions. Similar as we know that 21cm line is the transition of spin-flip of a neutral hydrogen.

Infrared (IR) regions is typically where the molecular lines are seen. Wikipedia has good and brief discussion.

Asteriods are cold so we expect molecules to form. Therefore, we expect to see lines in IR region the most. To be more specific, surface temperature of asteriod is ~346 K, which is equivalent to ~83714 A at max emission (assuming blackbody radiation and following Wien's law); this is IR.

Also note that, what we see is the surface of the asteriod, not the inside.