Why the Irish Supreme Court ruled that it would be unconstitutional for Ireland to ratify the EU–Canada Comprehensive Economic Trade Agreement without a referendum

Ireland has signed many treaties and international investment agreements over the years. It has joined various international bodies, like the European Union, the United Nations and the Council of Europe. All of those actions have created obligations and benefits for Ireland, involving some element of give and take. Why is it then that only some of those agreements require ratification by means of referendum?