asset returns the public path of the given asset path (which can be a CSS file, a JavaScript file, an image path, etc.). For projects that are published, the asset function returns the CDN path of the given asset path:

{{ asset('images/header-background.png') }}
{{ asset(some_var) }}

Note: The asset function only resolves files from the public directory in the project folder.