I was trying to add css class to nav items.
The documented function call in WordPress docs was
apply_filters( 'nav_menu_css_class', string[] $classes, WP_Post $item, stdClass $args, int $depth )
But I tried adding the following to functions.php in my child theme doesn't work.
apply_filters('nav_menu_css_class', ['nav-item']);
But the adding the following to functions.php works as expected.
add_filter('nav_menu_css_class', fn () => ['nav-item']);
Why do add_filter works but not apply_filters?