We see in Genesis 11 a bit of a repetition.
Adam and Eve have three sons. Noah and his wife have three sons.
Of Adam’s three boys, one is bad and God focuses on the third, Seth. Of Noah’s three boys, one was bad and God chooses to focus on a third, Shem. Before he introduced Noah, Moses talked about how bad the people of the earth were. Before he introduces Abraham, he talks about how bad the people of the earth are.
The genealogies of chapter five introduces us to the story of Noah. The genealogies of chapters 10 & 11 move us to Abraham through his ancestor “Peleg” (mentioned in 10:25 and 11:18) during whose time the story of the tower of Babel occurs.
There is a warning here.
This is what happens when people decide to disobey God. God had told them to “spread out” (fill the earth), but they decided to stop in Shinar. It is what happens when people walk away from God. Note that when the Lord kicked Adam and Eve out of the garden, he put a gate and guard on the east side. But he needn’t have bothered. No one was coming back. Can moves east of the garden. Lot moves east toward Sodom. Jacob goes to the land of the eastern peoples to get a wife. Don’t get too hung up on the direction. It is but a literary device to talk about people moving away from the Lord.
The Babel story is what happens when people seek their own grandeur (make a name for themselves) rather than seek the blessing of God, and what happens is that God ruins their plans and scatters them. God will be exalted by His creation. He deserves it because He is the Creator and those who ignore Him do so at their own peril – and it will be perilous.