Then he led out his people like sheep
and guided them in the wilderness like a flock.
He led them in safety, so that they were not afraid,
but the sea overwhelmed their enemies.
Psalm 78 recounts the history of Israel from its very beginnings right up to the Babylonian Exile. It is a song of worship, recounting the history of God's people from the perspective of worshipping God for what He has done. It is a worship celebration of sovereignty. It recounts both the Exodus and the Exile as sovereign works of God that brought Him glory as He showed Himself strong among Israel.
The God of the Exodus is Israel's Deliverer. He fought back Pharoah's armies. He led the nation like a flock of sheep through the wilderness. He provided for their every need as He led them eventually to the Promised Land. No one could oppose them, and indeed, the only harm they suffered during this time, they brought on themselves through idolatry and disobedience to God.
The God of the Exile was Israel's Discipliner. He graciously warned them by prophets to return in covenant with Him. They would not. And so the curses of the covenant led to their Exile. The land that God gave to them was taken away and overrun by Gentiles. God's people were marched away as captives in Babylon. There they wept and returned to God, and just as in the Exodus and wilderness, a generation suffered until God brought them back to His Land, to Jerusalem again by His sovereign hand.
God is as sovereign, gracious, and loving in Exile as He is in Exodus. He is a Deliverer who will discipline those whom He loves. And in Christ we know Him the same way. He delivers us in Jesus from the slavery of sin, but will also lovingly chastise us if we are not true to following Him. His sovereign hand will lead, love, and discipline the children that He loves.