How did an obsolete Surface-to-air missile like the Soviet SA-3 manage to shoot down the most advanced US stealth aircraft like the F117 nighthawk?

As was brought out by other answers, it was a combination of factors, of which luck definitely wasn’t a part, which resulted in the shooting down of the ill fated F-117 at the hands of the 3rd Battalion of the 250th Air Defence Brigade of the Yugoslav Army commanded by the resourceful and competent Col Zoltan Dani.