In MALDI, the sample is mixed with a matrix compound, typically an organic acid, which absorbs ultraviolet light. When a laser pulse is directed at the sample, the matrix absorbs the energy and facilitates the ionization of the sample molecules. These ionized molecules are then analyzed by a mass spectrometer, which provides detailed information about their molecular weight and structure.