When Noah’s flood had reduced the world population to 8, and while the population was recovering for a while after that, everyone in the world spoke the same language. People who had moved to the East started to build a great, unifying city with a huge tower that would reach to the heavens.
But when God came by and found out what they were doing, he was worried that if humans kept this up, before long they would become all-powerful. God doesn’t like people to be like him, so he sabotaged their project. God confused the humans’ languages so they couldn’t understand each other well enough to work together, and they were scattered all over the world.