What is the algorithm used in pbrt-v3 for triangle intersection?

Where's this algorithm come from? Any references?

And a specific question, when the authors compute the transformation from world space to ray-triangle intersection coordinate space, what's the permutation step for?