I would like to know how the software decides whether fonts are in a family or not. What kind of (meta)data does it look up?
I am trying to write a script to edit files so that they are grouped by family but I can’t seem to figure out how this is decided.
Yes, Yuriy is right as far as I know. There are hierarchical layers of style names and in the specific family layer the name has to be exact the same. You can study this e. g. with font converter TransType4 or other font design software. Sometimes also professional font designers does not group the styles.