When the last Pleistocene Glacier (the Wisconsin) plowed southward, it scoured out the Great Lakes from a network of ancient river valleys. As the Ice Sheet melted back to the north, beginning about 15,000 years ago, massive amounts of meltwater collected in those lake basins, spreading onto the surrounding Lake Plains. Since drainage through the St. Lawrence Seaway was blocked by ice, the glacial lakes had a much larger surface area than they do today; Glacial Lake Algonquin was the predecessor of Lake Huron while Glacial Lake Warren would become Lake Erie.
Glacial Lake Iroquois was the predecessor of Lake Ontario; it was three times as large as Lake Ontario and its surface was 100 feet higher, essentially equal to the elevation of Lake Erie today. As Lake Iroquois continued to enlarge (receiving meltwater directly from the glacier and from the other Glacial Lakes), its waters spilled eastward to the north and south of the Adirondacks; the north spillway gave rise to the Hudson Valley while the southern spillway became the Mohawk River Valley. This major flooding event began about 13,300 years ago.
Once the ice retreated beyond the St. Lawrence Seaway, the Great Lakes drained through that channel and eventually dropped to their current levels; of course, the Niagara River and its Falls developed during that period and connections to the Hudson and Mohawk River watersheds were abandoned.