How does the CTS tool determines the modules or number of test to be run on any particular android device?

I have executed CTS in 2 different android devices (Android phone and Android TV), the number of test cases and modules differs for both . As per my understanding the supported modules and related test are populated .

I wish to know that how the modules and test counts are determined as soon as we start the "run cts" in cts-tradefed ??