The term compile has many meanings when it comes to applications.

When you compile C+ you are converting it to machine language. When Twig compiles a template it creates plain optimized PHP code.  Compared to regular PHP code, the overhead is reduced to the very minimum.

When referring to CSS, it is the process of taking LESS or SASS, which are languages that are processed into CSS. For example, Bootstrap 4.1 is written in SASS and the source files contain variables and mixins that are defined during the development process. The source files have to be compiled to CSS to be interpreted by a browser.  CSS can also be minified into a reduced file size by removing the whitespace, allowing it to be downloaded faster.  Sometimes when referring to compiled CSS, minification is implied.

When referring to compiling JavaScript, it really means bundling different modules, concatenating, and minifying the JavaScript.