I was well aware of the Polish-Lithuanian-Teutonic war and Battle of Grunwald, and I began to research the politics of the time out of a combination of interest in both Polish history and religious orders of the Roman Catholic Church.
However, a simple Google search revealed some ten conflicts between the Poles and the unfortunate warrior-monks of German origin.
Obviously, each war has a slightly different cause, and it could be easy to simply say that the Teutonic Knights were invaders and the Polish simply fought to repel them, but that is the case of many many conflicts.
A suppose a more accurate question would be: why did the Poles have to spend centuries to fight off these invaders when said invaders themselves were, almost from the beginning, having such debt issues.
From my understanding, it was these wars with the Polish that ended up ruining the Teutonic Knights.
I hope I'm not too late to answer:
Teutonic Knights were not, strictly speaking, invaders - they had rights to some land due to the privileges given to them by Konrad of Masovia, and they were binding throughout all of the conflicts, making it virtually impossible to completely chase them from Poland. So that was the legal perspective. From diplomatic point of view, Poland had to tread carefully around the Knights, as they were supported by the Catholic West. Poland was still keeping trade with pagan minorities, not to mention its lack of military support during the crusades, and doubts about the Polish kings' faith, especially Jagiello, as he was from pagan Lithuania. Any military action would show Poland to be unfaithful to the Church and be used as an excuse for invasion from the Empire. Grunwald and the Jagiellonian war with the Knights was caused by trade war on the Vistula wheat, a matter so grave all caution had to be thrown to the wind. Afterwards, it was a slow descent, ending in the final war and the Prussian Tribute.