What is a pure function?

I’m trying to understand how exactly this works. Is this discussion only for subroutines and not also functions? Is the idea that the compiler does not know the return type+kind of the argument at compile time, but is only known at run time?