`PyEval_SaveThread` saves the current Python thread's state and releases the GIL, setting the interpreter's current thread state to NULL. `PyEval_RestoreThread` then uses the saved state to reacquire the GIL, making the thread active again in the interpreter.