Yes that ratio is what makes the threads.
You have a 12 tpi leadscrew and 40 T spindle gear, if you fit a 40T to the leadscrew it will cut 12 tpi as it's a 1:1 ratio
Fit an 80T and it now cuts 24 tpi as it's slowed down by a 2:1 ratio
In a straight drive train, i.e. just one row of gears any idlers in the middle run don't count as they cancel out.
John S.