At the time of the arrival of Rasulullah at Madinah, there were three Jewish tribes viz. Banu Quinuqah, Banu Nadhir and Banu Quraizah. The Jews were traders and merchants and they controlled the economy of Madinah. There were always differences between the Jews and the Arabs of Madinah which led to skirmishes between them.
After settling in Madinah, Rasulullah made peace between the Muslims and Jews. They agreed to help each other and defend Madinah from outside aggression. This was called a Treaty (agreement). This treaty gave all the people of Madinah the freedom to practice their religious teachings without any harassment and their goods and lives were not going to be interfered with. The idea of this treaty was to try and bring the Muslims and Jews to live in peace and defend the city of Madinah from anyone who wanted to cause harm to it.
In the event of any quarrel between two parties and if no agreement is reached then Rasulullah would give the final decision which nobody would go against.
Contents of the biography of the Prophet Muhammed