LLVM (Low-Level Virtual Machine) is a set of tools and libraries that facilitate the creation of compilers and other code manipulation-related tools. It provides a modular infrastructure for intermediate representation (IR), code optimization, machine code generation, and execution.
First of all, the compiler is written in Rust. So we have easy access to the LLVM-C bindings, which is an API that allows generating corresponding IR for the C programming language. The raw LLVM-C bindings in Rust are from the llvm-sys crate. We use a wrapper around it, much simpler to use, called inkwell, which is a Rust crate, which is a wrapper around the raw LLVM-C wrapper. We use Inkwell to generate the intermediate LLVM code, to then pass it to Clang so that it compiles it into its respective binary.
And at the end of the day, this is how the compiler works, at least at the moment. However, it does not represent the entire operation of the compiler, since there are optimization and verification phases of the intermediate code, but that is for another occasion.