What is the difference between thread number 20, 32 and gsm?

We know the fact that the thread number 20 is heavier than the thread number 32 but the weight of a material does not always determine its quality. Even if the factory uses low number thread but weaves with low density, the fabric will be thin and shrink a lot. Therefore, it is better to know the fabric weight which is measured in grams per square metre (gsm).