When state A passes agreement with state B it allows any players from state A to take part in wars of state B.
In the case of both states passing this laws this agreement will be called Bilateral.
You can see the list of this agreements on the state page.
Inside the political blocs members can vote on the in-bloc agreements.
In that case all the players from any region of the in-bloc states can take part in any in-bloc war.