In chapter 3.2, Uddhava begins a description of Krsna’s pastimes, starting with His childhood pastimes and continuing into the pastime of lifting Govardhana Hill and his pastimes with the Gopis. Now, he continues with His pastimes out of Vrindavana.
Krsna went to Mathura and killed Kamsa to save his parents, Vasudeva and Devaki who he was imprisoning. Kamsa was so powerful that even demigods were afraid of him, but Krsna killed him without difficulty, after exterminating his demoniac allies.
When Krsna was in the Gurukula, He played the role of a perfect student, being extremely obedient to His teacher, Samdipani Muni, and learning the Vedas by just hearing them once. After finishing His studies, he rewarded His teacher by bringing his dead son back to life. Krsna knows everything and is all-powerful, but he plays these pastimes to teach us the necessity of learning from the spiritual master and as far as possible rewarding him for his efforts.
Srimad Bhagavatam #19: The creation of the material elements