In Fangorn Forest, Merry and Pippin drink Treebeard's Ent-draught (although, in the movie this is just water from a spring), which makes them taller.
Why does this happen?
Source text from The Two Towers:
The drink was like water, indeed very like the taste of the draughts they had drunk from the Entwash near the borders of the forest, and yet there was some scent or savour in it which they could not describe; it was faint, but it reminded them of the smell of a distant wood borne from afar by a cool breeze at night. The effect of the draught began at the toes, and rose steadily through every limb, bringing refreshment and vigour as it coursed upwards, right to the tips of the hair… He poured them out two full bowls from a stone jar; but from a different jar. The taste was not the same as it had been the night before: it was earthier and richer, more sustaining and food-like, so to speak.
Ent-draughts were the mysterious and potent waters consumed by the Ents. Though little is known about them in detail, they seem to have been made from river-water, but with unique and subtle flavours reflecting the Ents' association with trees and forests. The first time Merry and Pippin imbibed an ent-draught it reminded them of the smell of a distant wood brought from afar by a cool night breeze. The second time they drank the flavour was earthier and richer, more food-like.
Their power of growth was most evident when they were drunk by beings other than Ents: the Ent-draughts taken by Merry and Pippin added three inches or more to their heights, making them the tallest Hobbits in the history of the Shire.
As best I can tell, nothing else is explained about the drink, but Fangorn is an ancient forest, and no one knows much about it. It appears to be a more "wholesome" alternative to the "orc-draught" that Merry and Pippin were given while with the Uruk-hai, and in that way, possibly comparable to Lembas.
Ugluk thrust a flask between his teeth and poured some burning liquid down his throat: he felt a hot fierce glow flow through him. The pain in his legs and ankles vanished.
Merry got up. ’Yes,’ he said, ’I can manage it. Lembas does put a heart into you! A more wholesome sort of feeling, too, than the heat of that orc-draught. I wonder what it was made of. Better not to know, I expect. Let’s get a drink of water to wash away the thought of it!" (The Two Towers, The Uruk-Hai)
To some degree, it was known to other peoples or became known to them, as Gimli notes:
'That you certainly are not,' said Gimli. 'But what did I say? Mortals cannot go drinking ent-draughts and expect no more to come of them than of a pot of beer.' (The Return of the King, The Field of Cormallen)
Suffice to say, it's a minor plot point in the series.