Why it works
4...Nd7 develops 'flexibly', and blocks the one square the queen will need. 5.Bxf7+! Kxf7 6.Ng5+ Ke8 7.Ne6! and the queen is walled in by her own army: the d-file is blocked by the knight on d7, c7 by its own pawn, and fxe6 is impossible because the f-pawn died on move five. The queen has no square at all: Black's best is to give it up for the knight with 7...Nb6 8.Nxd8 Kxd8 (6...Kf8 7.Ne6+ forks the same way, and 6...Kf6 7.Qf3 is mate), a queen and a pawn for a bishop and a knight, engine +4.6. One developing move built Black's own prison.
Refutation
4...Nf6 is the move the Pirc wants anyway: it develops towards the centre, covers the g5/e4 complex and, the real point here, leaves d7 free as the queen's escape hatch, so the whole Bxf7+/Ng5+/Ne6 machinery never gets started. The engine calls it a normal opening (−0.5 for Black, standard Pirc territory).