Motivation for sure. It’s easy to self-learn on topics that really interest you. The hard part is to learn those topics that don’t interest you (and may be very tedious and/or frustrating) but are crucial as a foundation for the topics that do.
I found by going back to uni I have been forced to learn a lot of things which I wouldn’t have taken the time to look at before. And they are actually really interesting and useful!
I’d say that it is mostly a matter of self-discipline rather than motivation, at least for me.