HPLC (high performance liquid chromatography) compares an "unknown" sample to a reference sample.
It is just chromatography -- a separation of a solution into its parts because each compound in the solution will interact differently with the substrate of the chromatography "column." I am simplifying it of course but you get the point: each substance will travel at different rates through the substrate. This is similar to when you spill water on a paper with ink writing on it -- the ink will separate into various colors (each color is a compound) and some travel further from the original spot because they interact less with the substrate (the paper).
So with HPLC you are running a known sample and measuring it's peak (when it comes out from traveling through the substrate. Then, you compare that with the unknown sample to determine the presence of and concentration of compounds in the solution.
HPLC will indeed confirm the presence (or lack thereof) and concentration of a compound if a good reference is available.
When applicable, GC/MS is superior in some ways because of the capabilities of MS.
GC (Gas chromatography) work similarity to HPLC except in this case the sample is run in the gaseous phase as opposed to liquid phase.
then each fraction is next passed into MS.
MS (Mass Spectrometry) is much more complex -- I will try to dumb it down.
With MS the sample (or fraction that was already isolated via chromatography) is ionized and fragmented, and accelerated around a bend in a magnetic field -- like cars turning a corner on a race track those with a greater mass with have a wider turn.
This way the charge to mass ratios are determined.
Compounds have distinct patterns and can be identified by the measure of the ions and the mass to charge ratio.
There are specific and predictable ways a molecule will fragment and each fragment is then detected resulting in the ability to deduce what these fragments must have originally been when they were a whole molecule.
Mass Spec schematic: