A treaty is an agreement entered into between two or more nations by which each agrees to abide by certain limitations on its behavior set forth in the document. Much international commercial law is governed by treaties involving many nations.
A peace treaty is a particular kind of agreement setting forth the terms for a cessation of hostilities between nations.
Historically, some nations have entered into treaties requiring that when one signatory to the treaty is attacked, all signatories will treat the attack as though it were against their own territory, and will come to the defense of the attacked signatory. A collection of treaties of this type is often considered to be a significant contributor to the scope of the First World War. As nations became embroiled in that conflict, allies with whom they had signed treaties were compelled to enter the war in support of their obligations.