Article I, Section 8 of the US Constitution states that "Congress shall have the power to regulate Commerce with foreign nations and among the several states, and with the Indian tribes" thus determining that Indian tribes are separate from the federal government, the states, and foreign nations
This leads to the Principles that 1Tribal authority on Indian land is organic and is not granted by the states in which Indian lands are located And 2 that Congress holds a Trust relationship with the Tribes and thus a duty to protect the Tribes.
Thus Tribes hold Sovereignty in their lands distinct from the US federal government and thus can enter Treaties with Congress.