It looks for a Movie or a Sports tag in the metadata and if it doesn’t find either it assumes it’s a TV show/series.
See this documentation series:
documentation