When you run a PCR reaction, you are making copies of a DNA sequence of interest (cDNA in case of retrotranscription, since retrovirus have RNA as the genetic material). The sequence of interest is presumed to be in a sample, that you take from the patient, or some organism (I say 'presumed' because the PCR is precisely to confirm this). These copies are made by a group of 'generalist' enzymes, called polymerases, and by generalists I mean that they do not discriminate on which DNA sequence they are copying. But, they cannot copy DNA de novo (from scratch). The copying process needs to be 'primed' by a short sequence of nucleotides that is complementary to the DNA of interest. These are called primers, and they effectively serve as probes to target the copying of the specific sequence you need to amplify. And this is where scientists put a lot of care on: primer design. Bad primers will not be very specific, or will not be very efficient during the amplification process. As for the 'machine' that actually detects the copies, there are many variants. The most typically used in research and diagnostic laboratories, involves staining the amplified DNA with some molecule that binds nucleic acids (which there are many), and visualize it via DNA electrophoresis. What you visualize is a population of DNA copies (via the staining you make), so you need to know beforehand what to expect. For instance, do you expect a small fragment (a couple hundred basepairs) or a big one (a few thousands?). You have a 'ladder' (also called marker) that gives you a reference to compare, like in this image:
People know what to expect because they already know the DNA (or RNA) sequence they are amplifying (otherwise they could not have designed the target primers). They know the sequence because they've done some form of nucleic acid sequencing (labs, health institutes, and so, do this all the time and deposit the sequences in some platform, for instance GeneBank).
A 'positive' amplification will give you a band in the expected size range, and no other bands (because your primers are targeted for a particular DNA sequence). But as you mentioned, there exists also a multiplex PCR reaction. In it, you design multiple primers to target different sequences (using the same DNA sample -e.g. from a patient or organism-), but the verification process is basically the same. Here people are extra careful to avoid cross-interactions among the primers added to the reaction.
PCR is a family of techniques, not a single one. There are variations in the actual process, and also in the 'detection' (for instance, qPCR uses real time detection of copy numbers). But the general principle is the same: primers are specific, while the 'detection device' is not really.