He did a good job in the round before that against the cage, in stopping Khabib from getting the high crotch grip he likes to lift people with (which he [Khabib] did successfully in round 2 after stunning McGregor with the right, setting up that major sequence of ground and pound) by using a pumphandle/arm drag grip, which was an interesting wrinkle.
The difference between what he was doing before, when it worked, and what he did in round 4, when he got his back taken, was that before, he was standing up with both legs under him, back flush against the cage, which blocked Khabib from going behind when he was in a perpendicular posture leaning in down by the hips. In the last case though, McGregor committed an unforced error by unthinkingly trying to go back to that arm drag position while his knee was down, exposing the back angle to Khabib, which he capitalized on.
I would not say he accepted the take down in round 1 except in the sparest sense of fatalism; he was trying to stop Khabib and Khabib put him down anyways. He showed a surprising level of defense i did not expect though, and there were a couple moments there where it looked like Khabib was going to lose it. Two specifically come to mind, where Conor managed to get to his feet(foot) while downblocking/framing off of Khabib; the first time he bowled him over onto his hip, the second time he was circling away with the frame in place.
I would say, if it were any other lightweight in the UFC currently, he probably would have broken free and gotten out in those moments. But in those moments Khabib had pure guts and was able to grimly hang on to the leg until he was able to get the edge he needed to sit Conor to his hip and get the double to finish. Maybe before that too even, since Khabib initially went in with a rather telegraphed long distance shot that Conor had a good sprawl on, but where Khabib was able to crawl up into a leg anyways.
The basic essential thing i'd say that ultimately did him in in that exchange was, he lacked a sense of urgency. The sense of urgency you would need to get the better in an exchange with someone of Khabib's caliber. He was able to get to good positions, but each time he failed to fully capitalize. This is probably due in part to the fact that McGregor likely did not have training partners on Khabib's level of skill either, which would give him a feeling for what you would need to do to succeed against guys of that level. By way of contrast, you can look at how Tyquil handled Maia shooting in on his legs; each time Demian would grab a hold, or even look like he was going for a hold, he would be turning out and jerking away like a trapped rat. There are moments where 'no expense is spared', because paying up right then will save you a lot of dear expense to pay subsequently.
The fight was surprisingly back-and-forth in ways, since by the nature of ground-fighter vs stand-up fighter match ups they have a tendency to be squashes for one side or the other. Khabib won by stoppage but looked human at moments. In particular, he once again encountered a difficulty that i have long observed bedeviling would-be grapplers in the cage, even at the highest levels; ending up wasting more energy on top than their opponent does, such that when they get stood up again by the round ending and meet again by the next bell, the man who was on bottom is ready to go and starts piecing up the man who theretofore looked like he was controlling the match (this is why it's so important to learn, know how to, and improve at, Giving The Presh).
If i were McGregor's corner, i would have focused less on 'open field' defense and more on escapes/getting up from the ground and against the cage, better participating in that dynamic. That is how Gegard Mousassi was able to beat Chris Weidman, how Robbie Lawler was able to beat Johnny Hendricks in their rematch, and how Conor himself was able to beat Chad Mendes (this would incidentally also be more in line with the skillsets of his training partners like Danis, who tend to be more focused on matwork).
Another interesting interaction in the third round while Khabib was getting his breath back was the clinch fighting. When McGregor would preempt a non-committal shot, Khabib would draw up and stop pressing the action. This is a habit i tend to see even from very good wrestlers transitioning to MMA, where if you don't feel you have a good entry, it's smart to not try and put yourself out on a limb by forcing it, potentially landing you in bad situations or counters you are less able to deal with. The only thing is, in the clinch, the action never really stops even if you aren't going for a TD, and Conor would be landing knees and elbows in these moments. You can see the most glaring example of this sort of hole being exploited in Demetrious Johnson's one round dismantling of Henry Cejudo in their first meeting, or in Tyron Woodley's losses vs Jake Shields and Nate Marquartd. Greater ability at fighting in the clinch is really something pretty much any sort of fighter can benefit from in MMA, whether they like to fight on the ground or in neutral.