Compilers intelligently offload LLM computations to highly optimized libraries (like cuBLAS or cuDNN) based on three key factors: the operation type (e.g., large matrix multiplications), the target hardware's available vendor-specific optimizations, and the potential for better performance compared to generating custom code for that specific operation.