I can tell you from experience that a lot of what is going on isn't readily evident to anyone. The top guy is really just trying to stop the bottom guy from getting into an advantageous position. It's not really to knock out but to distract and get him to release since the top guy can't do anything else with that hand to improve his position. Haven't seen the match, but it's possible that the bottom guy just secured enough of his leg to be ready to shift position, and so the guy had to change tactics. From what I can see there, the top guy, while appearing that he has control, really doesn't. The bottom guy has more control. There have been several situations where the guy on top, seemingly in control, while the guy at the bottom seemed to be completely out of it, loses the match because of unseen movements.
REF: Studied and fought in Shidokan circuit for a few years.
This right here pretty much sums it up; dude on bottom is going for advantageous position, dude on top is trying to prevent it; pretty sure back of the head hits are fouls also or something like that. You definitely have to be cognizant of that kind of thing; because "I didn't mean to" doesn't really count.
Also, I don't believe there is a rule that you can't knock out the person if you have the chance to while you are on the ground. There's just a ton going on. Everything has points, if the guy diving on bottom manages to get the other guy on the ground, that'll be take down points; as well as whatever position he gets into afterwards; as well as points for connecting blows I believe.
K1 has different rules, like I think you can do heel drop kicks to a person on the ground, not sure that that kind of thing is allowed in ufc.