How does python's threading module use the customized backend?

I am not clear on how python wrappers on cpp work and I find the following confusing. I am running TVM on x86 CPU. I noticed that in the autotvm.task.extract_from_program() function, the native threading module of python is used to build threads. And then the customized thread_pool is used when running the start() function of threading module. How does that happen? Could anyone point me to some files which make this happens? Thank you so much!