Many have debated for a long time about whether this story and its counterparts in other cultures are actually based on a real event. Does this myth reflect some literal flood that our ancient ancestors barely survived? Scientists have come up with plenty of theories—from rising sea levels after the Ice Age, to comets crashing into the ocean—to explain how it might actually have happened, but nobody can know for sure.
Whether a real flood happened or not, the image of a guy building an ark to survive a catastrophic flood sent by a divine force is one that pops up in tons of cultures. Very often the message is the same: humanity had better be good, or we will pay the price. You could also see the story as an allegory representing humankind's struggle against the seemingly uncontrollable natural forces that make up our world.