Mass spectrometry is an analytical technique that identifies unknown compounds by converting sample molecules into ions, characterizing them by their mass-to-charge ratio (m/z), and measuring relative abundances. It works by ionizing samples, separating the ions based on m/z using an analyzer, and detecting the ions using a detector. The instrument consists of an ion source, analyzer, and detector system, and operates by producing ions, separating them by m/z, and detecting abundances to produce mass spectra that provide structural information about molecules.