States would agree to be bound by rules outside their immediate control because they believe that it is in their self-interest to do so. When they do this, they are acting on the basis of liberalism/idealism, not on the basis of realism.
Under realism, states conceive of their interest purely in terms of power. They will not do anything to compromise their power and therefore are not likely to agree to such rules. Under liberalism, however, states can take a longer view. They might understand that their agreement on these rules will encourage other states to be bound by the same rules. The more rules are created, the less anarchic the international order becomes. In the long run, then, the states will actually become safer and more secure by agreeing to be bound by these rules. This is why they will agree to do so.