In the story of the Tower of Babel, people hoped to built a city and a tower with its top in the heaven so that they could make a name and prevent being scattered. However, the act of trying to become famous turned to be the sin. Human is merely human, not divine, they should not have disobeyed God and tried to become God. God, thus, baffled the language of people and scattered them from all over the earth as a punishment so that they would stop building the city and tower
In the story of Cain and Able, Cain and Able were brothers but Cain slaughtered Able one day because God had accepted Able and his offerings but refused Cain's. Later when God asked Cain where his brother was, Cain claimed that he did not know, which was a lie. The sin of this story was that Cain had not only murdered his brother but deceived God. The punishment God gave Cain was giving a mark on Cain's forehead and cursing the soil to Cain, making him an endless wanderer on the land.
In both stories, people commit crimes and created sin. God gave them different punishments because they made different sins. One of the sin was people grew arrogant and thought themselves could be God one day, another was commiting a murder and was dishonesty. However, God also made some similarities to their punishments- God did not kill any of them for commiting serious crimes but only gave them warnings to help them review their own act and notice modesty.