Not a fluke. JDS saw the opening and capitalized, as a fighter is trained to do, plain and simple.
Cain fought very differently in the 2nd and 3rd fights than in the 1st, while JDS fought more or less the same in all three, so that's why Cain won. He had a poor plan for the first fight and he got caught. You can't get caught by JDS cause 9 times out of 10, you'll end up unconscious. Cain was more aggressive in the 2nd and 3rd fights because it kept JDS off balance and kept him retreating. He shot for takedown after takedown and landed a fraction of them, but the act of shooting the takedown and keeping JDS against the cage allowed him to gradually wear JDS down and land his own punches when they separated. It also made JDS far less effective offensively.
Cain adapted to beat JDS, but JDS did not adapt to beat Cain. He used a very similar gameplan to the 2nd fight in tonight's fight and it failed once again.