Why does a warp consist of 32 threads? Why is a thread not say 16 or 64 threads? Whats the hardware

As already has been said: it simply is a tradeoff between different factors. They could have made it 16 or 64. In fact, for some GPUs from AMD/ATI the equivalent of what is called ‘warp size’ at NVidia is 64.