Moses and the Israelites sing a song to God after their triumph. Wouldn't you be singing after that?
The song that the Israelites sing has a ton of historical nuggets: it talks about the character of God, has a different understanding of water (check out "Symbols" for more), and also celebrates the destruction of the Canaanites.
But wait. The Israelites haven't even gone into Canaan yet, so what's going on? There's a contradiction in the text.
This one's a sure bet. Why would you sing about something that hasn't happened yet?
We're pretty sure we have two texts from different times that were combined; so what we see looks like a contradiction, but it's just two different pieces of literature that got combined years after both were written. Voilà!
Back in the story, Miriam sings her own, slightly shorter, song.
As they're traveling in the deserts, the Israelites can't find fresh water. They complain to Moses, who asks God for help. The solution? Moses throws a piece of wood into the brackish water, and it becomes sweet.
God makes a rule that if the Israelites do right by God's rules, they won't be punished with the diseases the Egyptians got. Thanks, God.