A gut microbiome test identifies the bacteria in a stool sample by reading their genes rather than growing them in a culture. The lab extracts bacterial genetic material from the sample, sequences it and compares it against a reference database to estimate which bacteria are present and in what proportions. Because nothing is cultured, the test also picks up gut bacteria that are sensitive to oxygen and hard to grow in a lab.
The analysis is usually done in one of two ways. The 16S rRNA method reads only part of a gene that all bacteria share, which keeps costs down, but it usually identifies bacteria only to the genus level, one step above species. The metagenomic method reads all of the genetic material in the sample, identifying bacteria down to the species level and estimating their metabolic functions, so it is used when a more detailed microbiome analysis is needed.
Some people think of stool culture when it comes to testing gut bacteria, but a culture is used to find the specific organism behind an intestinal infection. A gut flora test looks at the makeup of the entire bacterial community rather than a single culprit, so the two serve different purposes.