My (very intuitive) take:
During the Tourmalet / Bejes stages, Vingegaard attacked mainly to win the stage. Especially in the Bejes stage, he got way more time than he thought he would get, because there was no chase at all for some time. Whether or not Vingegaard attacked before his turn, I don't know (see further). Vingegaard came to the Vuelta as back-up for Roglic, and to keep riding a bit (his calendar wasn't very full until the Tour), or his season would have been very short and without goals after July. So he didn't really have any fixed targets in this Vuelta (a GC win was no must), and his whole body language was one of being relaxed.
Roglic... he came to the Vuelta with way more ambition. He was the first GC guy. As he had already won the Giro, he could start without stress, and he was (and obviously is) in great shape. The problems started at Javalambre. Vingegaard could follow him (easily). Next, Vingegaard attacked in 2 stages and thus was intervening with Roglic' GC plans, and took away 2 opportunities from Roglic to attack / win a stage, on Tourmalet and Bejes. Roglic wanted to show his shape (he didn't train for nothing) by conquering Angliru. Vingegaard duly followed, but you already saw that Vingegaard was on crossroads: Vingegaard wanted to just follow Roglic and not force it, but he understood that this would as well end Kuss' hopes of the GC win.
So in the end, Vingegaard was the buffer that kept Roglic at bay, and he is such a good buffer that he easily could have won himself, but he showed everyone he didn't have to win and was happy with Kuss in GC lead. Roglic was more into the 'I want show everyone what they expect from me = race and win' mentality. But he also realizes that he can't shake Vingegaard, and that Vingegaard will thus win if Roglic attacks / drops Kuss again.
If Vingegaard and the team are to be believed, it was always the plan for him to go to the Vuelta, unless he was mentally/physically cooked after the Tour. Roglič on the other hand was only promised the Giro before the season started, and maybe they had still hoped to be able to persuade him to go to the Tour as a super duper domestique, but that didn't happen. Since he won the Giro, they couldn't exactly force him to stay at home. Then they probably also feared that Evenepoel and Ayuso could be so strong, that having two leaders would be their key to victory, especially when they couldn't be sure how Vingegaard would do with the Tour in his legs. But a situation in which one guy could end up losing time, because the other one got a gap to their opponents, was always going to be a possibility, but, as we know now, it turned out to not actually be a necessity for them to win the race.