in computer terms, all computers operate on 'machine language instructions' which are not friendly to reading by normal humans.
A compiler takes in the human readable form and outputs a file that is readable by the computer. This is done one time and can be re-read by the machine as many times as desired.
Whereas and interpreter takes the human readable code and converts it to machine code on fly line by line and feeds it to the computer. It has to do this each time you want to run that code/program. This of course takes more time to run the code as it has to be translated each time it is run.
Actually in your case of slicer to gcode, it is neither a compiler nor interpreter as it is changing the model to human readable code which is then fed into the compiled firmware on your printer controller to be converted to signals to the printer electronics to cause correct motions.
HTH