Inlining is about extra optimizations compiler can potentially do. Often that allows to remove large pieces of unused code, or eliminate common subexpressions. As a result less code is generated - meaning more bytes fit into CPU code cache and fewer bytes to execute, meaning code runs faster.
For example: https://godbolt.org/z/6T1KebExb
You can see in right side of code where inlining is forbidden (or just in general not possible), the compiler generates so much more code. Versus Left side compiler where everything is inlined to simple one instruction
mov eax, 450 - way more efficient code.
If you're asking about how code cache works - that is the same as data cache. Every time CPU wants to read next bytes of instruction to execute it must be in L1 cache. If it isn't then it will stall waiting for fetching it from main memory. That's why it prefetches them ahead of time - same way how data prefetching works. Nothing different there.