Psalm 78 displays the kindness of God towards His rebellious people (in this specific case Israel in the wilderness). Israel had developed a pattern of habitual sin, and many of us know that a pattern of sin is easy to develop. In this psalm Asaph identifies 25 problems which led to Israel continuing in a habitual pattern of sin.
(Psalm 78:1-8) Give ear, O my people, to my law; incline your ears to the words of my mouth. I will open my mouth in a parable; I will utter dark sayings of old, which we have heard and known, and our fathers have told us. We will not hide them from their children, telling to the generation to come the praises of the Lord, and His strength and His wonderful works that He has done. For He established a testimony in Jacob, and appointed a law in Israel, which He commanded our fathers, that they should make them known to their children; that the generation to come might know them, the children who would be born, that they may arise and declare them to their children, that they may set their hope in God, and not forget the works of God, but keep His commandments; and may not be like their fathers, a  stubborn and  rebellious generation, a generation that  did not set its heart aright, and  whose spirit was not faithful to God.
(9-16) The children of Ephraim, being armed and carrying bows,  turned back in the day of battle. They  did not keep the covenant of God; they  refused to walk in His law, and  forgot His works and His wonders that He had shown them. Marvelous things He did in the sight of their fathers, in the land of Egypt, in the field of Zoan. He divided the sea and caused them to pass through; and He made the waters stand up like a heap. In the daytime also He led them with the cloud, and all the night with a light of fire. He split the rocks in the wilderness, and gave them drink in abundance like the depths. He also brought streams out of the rock, and caused waters to run down like rivers.
(17-31) But  they sinned even more against Him by  rebelling against the Most High in the wilderness. And  they tested God in their heart by asking for the food of their fancy. Yes,  they spoke against God: they said, “Can God prepare a table in the wilderness? Behold, He struck the rock, so that the waters gushed out, and the streams overflowed. Can He give bread also? Can He provide meat for His people?” Therefore the Lord heard this and was furious; so a fire was kindled against Jacob, and anger also came up against Israel, because  they did not believe in God, and  did not trust in His salvation. Yet He had commanded the clouds above, and opened the doors of heaven, had rained down manna on them to eat, and given them of the bread of heaven. Men ate angels’ food; He sent them food to the full. He caused an east wind to blow in the heavens; and by His power He brought in the south wind. He also rained meat on them like the dust, feathered fowl like the sand of the seas; and He let them fall in the midst of their camp, all around their dwellings. So they ate and were well filled, for He gave them their own desire. They were  not deprived of their craving; but while their food was still in their mouths, the wrath of God came against them, and slew the stoutest of them, and struck down the choice men of Israel.
(32-39) In spite of this  they still sinned, and did not believe in His wondrous works. Therefore their days He consumed in futility, and their years in fear. When He slew them, then they sought Him; and they returned and sought earnestly for God. Then they remembered that God was their rock, and the Most High God their Redeemer. Nevertheless they flattered Him with their mouth, and  they lied to Him with their tongue; for  their heart was not steadfast with Him,  nor were they faithful in His covenant. But He, being full of compassion, forgave their iniquity, and did not destroy them. Yes, many a time He turned His anger away, and did not stir up all His wrath; for He remembered that they were but flesh, a breath that passes away and does not come again.
(40-55) How often  they provoked Him in the wilderness, and  grieved Him in the desert! Yes, they  turned back and  tempted God, and  limited the Holy One of Israel. They  did not remember His power: the day when He redeemed them from the enemy, when He worked His signs in Egypt, and His wonders in the field of Zoan; turned their rivers into blood, and their streams, that they could not drink. He sent swarms of flies among them, which devoured them, and frogs, which destroyed them. He also gave their crops to the caterpillar, and their labor to the locust. He destroyed their vines with hail, and their sycamore trees with frost. He also gave up their cattle to the hail, and their flocks to fiery lightning. He cast on them the fierceness of His anger, wrath, indignation, and trouble, by sending angels of destruction among them. He made a path for His anger; He did not spare their soul from death, but gave their life over to the plague, and destroyed all the firstborn in Egypt, the first of their strength in the tents of Ham. But He made His own people go forth like sheep, and guided them in the wilderness like a flock; and He led them on safely, so that they did not fear; but the sea overwhelmed their enemies. And He brought them to His holy border, this mountain which His right hand had acquired. He also drove out the nations before them, allotted them an inheritance by survey, and made the tribes of Israel dwell in their tents.
(56-64) Yet they tested and provoked the Most High God, and did not keep His testimonies, but turned back and acted unfaithfully like their fathers; they were turned aside like a deceitful bow. For they provoked Him to anger with their high places, and moved Him to jealousy with their carved images. When God heard this, He was furious, and greatly abhorred Israel, so that He forsook the tabernacle of Shiloh, the tent He had placed among men, and delivered His strength into captivity, and His glory into the enemy’s hand. He also gave His people over to the sword, and was furious with His inheritance. The fire consumed their young men, and their maidens were not given in marriage. Their priests fell by the sword, and their widows made no lamentation.
(65-72) Then the Lord awoke as from sleep, like a mighty man who shouts because of wine. And He beat back His enemies; He put them to a perpetual reproach. Moreover He rejected the tent of Joseph, and did not choose the tribe of Ephraim, but chose the tribe of Judah, Mount Zion which He loved. And He built His sanctuary like the heights, like the earth which He has established forever. He also chose David His servant, and took him from the sheepfolds; from following the ewes that had young He brought him, to shepherd Jacob His people, and Israel His inheritance. So he shepherded them according to the integrity of his heart, and guided them by the skillfulness of his hands.