What is the relationship between a nut thread and a screw thread?

when a spiral groove is cut over a hole, then it is nut thread.

when a spiral groove is cut over a shaft, then it is screw thread.