Code reconfiguration

First of all I need to explain that I am a beginner in arduino programming. I have done many experiments and with very good results. I've even solved some of the more complex problems. However, I'm still trying to learn the fundamentals of programming that often do not make sense to me. This code works correctly but the two functions void AS3935_ISR (); they do not make much sense to me.
I could live with this, but when I try to add this code inside a more complex one code, where I have access buttons to other levels, I do not know what I do with these two functions because I don't understand in fullness.
I just do not understand them and would like to understand ...

Thanks,

Cesar