Exodus 15:1-18. It was sung by “Moses and the people of Israel” (v. 1) after Pharaoh and his army drowned and Israel crossed through the sea on their way out of Egypt.
A chapter in the Bible can cover anywhere from a single day to hundreds of years.
As Jacob is about to die, he gathers his 12 sons to him and predicts the future of what will happen to their families. In poem form!
It’s important to really understand the story of Israel as a whole and not get lost in the details of this prophet or that king.