Disclaimer: this is my layman understanding. I am not involved or educated in anything like this. Consider my answer to be somewhat untrustworthy. I have no legal knowledge or training.
This is fairly basic software forensics, which has plenty of overlap with software reverse engineering as far as the technical skill set is concerned.
It is not sufficient for one to identify the evidence. One has to testify in court that during the search for evidence, one does not break any law (including contracts, copyrights, etc., or anything forbidden by law). Otherwise the evidence might not be used in a lawsuit.
As a result, such work must be carried out with heavy supervision of legal experts, etc. But the work in that environment would be pretty much like standard software reverse engineering. (See disclaimer above. This is just my imagination and from my reading of popular articles describing the same.)
As for practical techniques, notice that a lot of software contains constants, string literals (hardcoded strings), etc., which allow for quick indiscriminate scanning for potential targets. Typically, this "scanning" has to be done by yet another third-party - not by the same business entity that will be performing the detailed analysis - in order to comply with the law. The accuracy from this potential target search might be low, as it has been frequently publicly reported that false-positives do occur, and occasionally causes legitimate software to be temporarily taken offline. (Reports on the latter can be searched online; the former viewpoint about "low accuracy" is personal opinion and is not substantiated.)
After the initial targets have been found and the work is transferred to a proper software forensics team, the team would just reverse-engineer the binaries to recreate the structure, sequence, organization of the compiled software. In the superficial sense the compiled code do not directly resemble the source code, but software forensics can identify plenty of evidence that can lead a court judge to conclude that it is highly unlikely that the binary is not produced other than by compiling from the source code that is allegedly being infringed.