Sources : Adi Parva -> Sambhava Parva of Mahabharata (link1, link2)
When and why did Duryodhan give sweet kheer mixed with poison to Bhima?
Vaisampayana continued, 'Then the sons of king Pandu, having gone through all the purifying rites prescribed in the Vedas, began to grow up in princely style in the home of their father.
Whenever they were engaged in play with the sons of Dhritarashtra, their superiority of strength became marked. In speed, in striking the objects aimed at, in consuming articles of food, and scattering dust, Bhimasena beat all the sons of Dhritarashtra. The son of the Wind-god pulled them by the hair and made them fight with one another, laughing all the while. And Vrikodara easily defeated those hundred and one children of great energy as if they were one instead of being a hundred and one. The second Pandava used to seize them by the hair, and throwing them down, to drag them along the earth. By this, some had their knees broken, some their heads, and some their shoulders. That youth, sometimes holding ten of them, drowned them in water, till they were nearly dead. When the sons of Dhritarashtra got up to the boughs of a tree for plucking fruits, Bhima used to shake that tree, by striking it with his foot, so that down came the fruits and the fruitpluckers at the same time. In fact, those princes were no match for Bhima in pugilistic encounters, in speed, or in skill. Bhima used to make a display of his strength by thus tormenting them in childishness but not from malice.
Seeing these wonderful exhibitions of the might of Bhima, the powerful Duryodhana, the eldest son of Dhritarashtra, began to conceive hostility towards him. And the wicked and unrighteous Duryodhana, through ignorance and ambition, prepared himself for an act of sin.
But why did Bhima eat if it was mixed with poison?
Bhima was not aware of this:
The Kauravas and the Pandavas sat down and began to enjoy the things provided for them. They became engaged in play and began to exchange morsels of food with one another. Meanwhile the wicked Duryodhana had mixed a powerful poison with a quantity of food, with the object of making away with Bhima. That wicked youth who had nectar in his tongue and a razor in his heart, rose at length, and in a friendly way fed Bhima largely with that poisoned food, and thinking himself lucky in having compassed his end, was exceedingly glad at heart.
What happened to Bhima afterwords?
Then the sons of Dhritarashtra and Pandu together became cheerfully engaged in sporting in the water. Having made the other youths take exercise in the waters, the powerful second Pandava was excessively fatigued. So that on rising from the water, he lay down on the ground. He was weary and under the influence of the poison. And the cool air served to spread the poison over all his frame, so that he lost his senses at once.
Seeing this Duryodhana bound him with chords of shrubs, and threw him into the water. The insensible son of Pandu sank down till he reached the Naga kingdom.
Nagas, furnished with fangs containing virulent venom, bit him by thousands. The vegetable poison, mingled in the blood of the son of the Wind god, was neutralised by the snake-poison.
"On regaining consciousness, the son of Kunti burst his bands and began to press the snakes down under the ground. A remnant fled for life, and going to their king Vasuki, represented, 'O king of snakes, a man drowned under the water, bound in chords of shrubs; probably he had drunk poison. For when he fell amongst us, he was insensible. But when we began to bite him, he regained his senses, and bursting his fetters, commenced laying at us. May it please Your Majesty to enquire who is.'
"Then Vasuki, in accordance with the prayer of the inferior Nagas, went to the place and saw Bhimasena. Of the serpents, there was one, named Aryaka. He was the grandfather of the father of Kunti. The lord of serpents saw his relative and embraced him. Then, Vasuki, learning all, was pleased with Bhima, and said to Aryaka with satisfaction, 'How are we to please him? Let him have money and gems in profusion."
"On hearing the words of Vasuki, Aryaka said, 'O king of serpents, when Your Majesty is pleased with him, no need of wealth for him! Permit him to drink of rasakunda (nectar-vessels) and thus acquire immeasurable strength. There is the strength of a thousand elephants in each one of those vessels. Let this prince drink as much as he can.'
"The king of serpents gave his consent. And the serpents thereupon began auspicious rites. Then purifying himself carefully, Bhimasena facing the east began to drink nectar. At one breath, he quaffed off the contents of a whole vessel, and in this manner drained off eight successive jars, till he was full. At length, the serpents prepared an excellent bed for him, on which he lay down at ease.'"
On Earth, other Panadavas started searching Bhima. Meanwhile, Bhimasena awoke from that slumber on the eighth day, and felt strong beyond measure in consequence of the nectar he had taken having been all digested. Seeing him awake, the Nagas began to console and cheer him, saying, 'O thou of mighty arms, the strength-giving liquor thou hast drunk will give thee the might of ten thousand elephants! No one now will be able to vanquish thee in fight. O bull of Kuru's race, do thou bath in this holy and auspicious water and return home. Thy brothers are disconsolate because of thee.'
"Then Bhima purified himself with a bath in those waters, and decked in white robes and flowery garlands of the same hue, ate of the paramanna (rice and sugar pudding) offered to him by the Nagas. Then that oppressor of all foes, decked in celestial ornaments, received the adorations and blessings of the snakes, and saluting them in return, rose from the nether region. Bearing up the lotus-eyed Pandava from under the waters, the Nagas placed him in the selfsame gardens wherein he had been sporting, and vanished in his very sight.
"The mighty Bhimasena, arrived on the surface of the earth, ran with speed to his mother. And bowing down unto her and his eldest brother, and smelling the heads of his younger brothers, that oppressor of all foes was himself embraced by his mother and every one of those bulls among men. Affectionate unto one another, they all repeatedly exclaimed, 'What is our joy today, O what joy!'
Then Bhima, endued with great strength and prowess, related to his brothers everything about the villainy of Duryodhana, and the lucky and unlucky incidents that had befallen him in the world of the Serpents. Thereupon Yudhishthira said, 'Do thou observe silence on this. Do not speak of this to any one. From this day, protect ye all one another with care.' Thus cautioned by the righteous Yudhishthira, they all, with Yudhishthira himself, became very vigilant from that day.