How was the waikato river formed?

The Waikato river originates at Lake Taupo,which is a lake that is situated in the center of the North Island of New Zealand . It is the largest lake in New Zealand.Its water fills an old volcanic crater. The river finally makes its way to the Tasman Sea at Port Waikato.