If chapter 10 of Genesis is the explanation as to how different nations came to be then chapter 11 is about how language came to be. It is another one of those weird early Bible stories where it feels like God is being petty.
All the Earth has one language and man decides to build a tower up that reaches up to heaven and God sees that if humanity continued to have one language then all things would be possible and God can’t have that so he crashes the tower, the Tower of Babel, to the ground and scatters the language of humankind so that they all speak different languages.
This is a bit of people explaining why things are the way they are but it does feel like God is being a bit petty. It also serves as a callback to the story of Adam and Eve. God didn’t remove them from the garden because they ate from the tree of knowledge of good and evil but because they might eat from the tree of life, because if humanity gained the ability to live forever then there would be no difference between humanity and God.
This early God that sent a flood because humanity became too numerous and scatters the language of man because they might accomplish too much doesn’t fit into the image of a loving God that appears later in the Bible. It could be argued that without the struggle and strife humanity wouldn’t become their best selves and God is showing a bit of tough love. I’m not a fan of that reading. I am not certain how to view this God of the early Bible and I am fine with that.
God isn’t meant to be understood by humanity, and perhaps works that were not the works of God were attributed to God when these stories first came into existence. Life of early humanity must have certainly been difficult and belief in a loving God would have been difficult. If you are an early human looking to explain the mysteries of life this is certainly one way to do so.