https://slack.com/intl/en-gb/help/articles/4403608802963-Ope...
Slack has much better history because you don't need to have been online when messages are sent to log them. Slack is absolutely more reliable in this regard.
IRC is easy to script because the protocol is so simple. But you leave so much on the table for that cost.
Obviously if your use case is text only that you don't care about being persistent and you lean heavily on scripting to get things done then IRC will do the trick. Otherwise it's such a crutch to do anything besides beyond that.
Logging is just different between the two.
For IRC, logging is outside the scope of the IRC protocol. Anyone can log anything anytime anywhere with whatever policies and procedures they want. This usually leads to each channel/project having some "official" log of the channel somewhere, using whatever they feel is good for them.
Slack on the other hand centralizes the logs, which removes lots of control into the administrators/slack developers.
So Slack's logs are likely easier to find, but that doesn't necessarily make them easier to use.
Persistency is also just different, IRC makes it your problem, but it's a solved problem if you care about it. irccloud.com and sr.ht both offer persistence in different ways as two differing examples to the problem.
Slack of course centralizes the problem and removes some control.
I personally think Slack and approaches like it (I prefer MatterMost) are great for internal things where administrators need central control of stuff for various reasons. For public things, I think Slack is a bad solution, and something like IRC or Matrix is a better solution to the problem of public chat.