They have it because IRA was willing to kill a lot of people to get it.
This is a part of the so-called Good Friday Agreement which was signed in 1998 after Northern Irish nationalists fought a 30 year war against the British state with an ultimate goal of becoming a part of Ireland instead.