Treaty of Versailles wasn't the reason they capitulated, The treaty was only drafted after the fact. Your right about it being a considerable contributing factor to WW2 though.
Massive Socio-economic/ internal conflict within Germany was the final deciding factor. That in addition to the lack of Forward momentum on the Western front. Germany's last hope was the massive influx of troops from the eastern front after Russia withdrew. Unfortunately for them right about that time The States joined the war and it was fairly balanced out.
Germany's economy was collapsing, Austria Hungary's was doing the same, and the Ottoman Empire was suffering massive losses in the desert.