Why it works
The Halosar Trap is often told wrong: 5...Qxd4 is not the mistake. Grabbing the second pawn is the engine's own first choice, and after 6.Be3 Qb4 7.O-O-O Black is still slightly better. The real mistake is 7...Bg4??, natural development with a hit on the queen, and nearly half the players at every rating make it. White ignores the threat: 8.Nb5! eyes c7, and with the rook on d1 covering d7 and d8, 9.Nxc7 would be mate — nothing black guards c7. So the queen on f3 is poisoned: 8...Bxf3?? 9.Nxc7#. Below 1800, taking the queen is the most common reply.
Refutation
7...c6! takes b5 away from the knight first, and Black stays two pawns up with the better game. Once the bishop is on g4, the best defence is 8...Na6, covering c7 — but the bishop no longer guards b7 and the knight on b5 has cut the b4-queen off from it, so 9.Qxb7 steps out of the attack with a hit on the a8-rook and the a6-knight, and White is winning anyway; 9...Rb8?? even allows 10.Qxb8+! Nxb8 11.Nxc7#. At 1600 White wins 77% of games after 7...Bg4 and 43% after 7...c6.