Gandalf and Pippin are known to have a complicated relationship, which boils down to different ideals and personalities. Most would attribute it to being that Pippin was a “fool of a took.”
Pippin was the youngest in the fellowship being 28 at the time of the War of the Ring. This would be younger than the hobbit coming of age at 33.
While the movies show this happening at Bilbo’s birthday party, with Pippin, along with Merry, starting a Dragon Firework, in the books, we don’t see it until later in the series.
Council of Elrond
Pippin, along with Merry, would join Frodo and Sam and they all would be waylaid in the Old Forest.
However, at the Council of Elrond, Gandalf actually stood by Pippin when Elrond doubted Pippin’s wisdom despite being left with 7 members out of the intended 9 – suggesting that Gandalf still cared for and trusted Pippin at least to some degree.
‘There remain two more to be found,’ said Elrond. ‘These I will consider. Of my household I may find some that it seems good to me to send.’
‘But that will leave no place for us!’ cried Pippin in dismay. ‘We don’t want to be left behind. We want to go with Frodo.’
‘That is because you do not understand and cannot imagine what lies ahead,’ said Elrond.
Though it could also be simply that Elrond wanted to send Merry and Pippin as messengers of the Shire. However later it would be revealed that Elrond doubted Pippin – to which Gandalf responds, trusting the friendship of the hobbits over great wisdom alone.
‘Neither does Frodo,’ said Gandalf, unexpectedly supporting Pippin. ‘Nor do any of us see clearly. It is true that if these hobbits understood the danger, they would not dare to go. But they would still wish to go, or wish that they dared, and be shamed and un- happy. I think, Elrond, that in this matter it would be well to trust rather to their friendship than to great wisdom. Even if you chose for us an Elf-lord, such as Glorfindel, he could not storm the Dark Tower, nor open the road to the Fire by the power that is in him.’
‘You speak gravely,’ said Elrond, ‘but I am in doubt. The Shire, I forebode, is not free now from peril; and these two I had thought to send back there as messengers, to do what they could, according to the fashion of their country, to warn the people of their danger. In any case, I judge that the younger of these two, Peregrin Took, should remain. My heart is against his going.’
‘Then, Master Elrond, you will have to lock me in prison, or send me home tied in a sack,’ said Pippin. ‘For otherwise I shall follow the Company.’
‘Let it be so then. You shall go,’ said Elrond, and he sighed. ‘Now the tale of Nine is filled. In seven days the Company must depart.’
…suggesting that they just had to fill the nine members, or that Elrond saw Gandalf’s point to trust the friendship of the hobbits over great wisdom alone. And Gandalf was right – without Merry and Pippin, the fellowship would be very different than it was.
Moria
When Pippin decides to drop a stone deep hole when the fellowship crossed the Misty Mountains, it woke something there, below the hole, which was evident by a hammer.
‘What’s that?’ cried Gandalf. He was relieved when Pippin confessed what he had done; but he was angry, and Pippin could see his eye glinting. ‘Fool of a Took!’ he growled. ‘This is a serious journey, not a hobbit walking-party. Throw yourself in next time, and then you will be no further nuisance. Now be quiet!’
Pippin was given the first watch ‘as a reward’ for a while, though Gandalf soon relieves him of this duty.
The Palantir
Pippin would grab the Palantir one night, seeing a large stone.
“Quickly now he drew off the cloth, wrapped the stone in it and kneeling down, laid it back by the wizard’s hand. Then at last he looked at the thing and uncovered. There it was: a smooth globe of crystal, now dark and dead, lying bare before his knees. Pippin lifted it, covered it hurriedly in his own cloak, and half turned to go back to his bed.” (TTT, “The Palantir”)
Pippin would get caught by Gandalf.
“‘So this is the thief!’ Said Gandalf. Hastily he cast his cloak over the globe where it lay. ‘But you, Pippin! This is a grievous turn to things!’ He knelt by Pippin’s body: the hobbit was lying on his back, rigid, with unseeing eyes staring up at the sky. ‘The devilry! What mischief has he done – to himself, and to all of us?’”(TTT, “The Palantir”)
He would look over and take Pippin’s hand. Pippin would continue seeing the object, and inform it that he was a hobbit and that the journey was not for Saruman. Pippin would see through the journey of the ring – before Gandalf would ask Pippin to go along with Shadowfax.
Minas Tirith
They would go to Minas Tirith to protect Pippin from Sauron’s forces. Sauron assumes wrongly that Pippin had the One Ring.
This suggests that Gandalf had Pippin’s best interests in mind despite being frustrated at times. Gandalf could also sense Sauron’s forces as he did in the beginning with Frodo, especially as Pippin just looked into the Palantir causing Sauron to believe that Pippin had the ring.