Why it works
5...d5 looks completely natural: the e4 knight is pinned down the e-file, so it needs a pawn behind it, exactly how Black plays in the Open Ruy Lopez. The difference is that here Black has not gained the tempi with ...a6 and ...b5: the bishop still sits on b5, eyeing the c6 knight. White doesn't rush to grab the knight: 6.d3! simply chases it away, and after 6...Nf6 the e5 pawn hangs. 7.Nxe5! takes it while attacking the c6 knight, and 7...Nxe5 is impossible because of the pin on the e-file. Black tries to hold on with 7...Be6, but 8.Nxc6 bxc6 9.Bxc6+ comes with check and hits the a8 rook at the same time. Black's whole structure collapses in three moves.
Refutation
5...Nd6! The main line of the Rio Gambit. The knight retreats to d6 and attacks the b5 bishop in return, releasing the pressure on the e-file and forcing White to commit. After 6.Nxe5 Nxe5 7.Rxe5+ Be7 the game follows well-trodden theory with rough equality, whereas 5...d5 simply drops material.