They are actually very successful in the Champions League in general. In recent years, as far as I remember, there were times when they played successful matches in the Champions League and unsuccessful matches in La Liga. That's why it's true that Real Madrid cares more about the Champions League than the league. They lost points in La Liga, but they can make up for it because they have a long league marathon ahead of them, but if they make mistakes in the Champions League, it will be very difficult to make up for it because they will play very few matches.
Clubs have targets every season, there's vast difference for these clubs, winning league games differentiate these clubs, we have the elite ones that have no challenge, always ready to gain position on the table and accumulating winning points, the average clubs that's having epic challenges towards oppositions. La Liga is competitive but not for Real Madrid and Barcelona, these teams owned the league, there's exceptionally no season that passes by without these clubs winning titles. Real Madrid have made the UEFA Champions League as their priority, so winning the UCL title becomes very easy for them.