There is certainly a substantial amount of theory regarding the thread of screws which we will never go into to below, but you could find a wonderful in depth description listed here on Wikipedia.
The courser the https://types.blog/types-of-screw-heads/