How does mesalazine work?

For some people it takes months and others not long at all. Is it just healing the inflammation until it’s fucked off? So it depends on how severe it is? Or does it just take a while for the effects to kick in?