Well, that's _part_ of why, but the fundamental reason is that NI is the rump of the Kingdom of Ireland within the UK, which, like Scotland, preserved a separate legal system even after political union with the UK brought about through the 1800 Act of Union.
[Aside: An interesting consequence of this is that England lacks a legal and political identity separate from the UK as the UK is an _extension_ of the Kingdom of England. Another interesting this is that even though it was part of the Kingdom of England, Wales _does_ have a legal and political identity because there are acts of parliament that _explicitly_ refer to it. The UK is a constitutionally odd country.]
With some of the NI parties screwing over conservative governments its why NI doesn't have the same laws as the UK