Filters are functions that WordPress uses to pass data through. Passing data through filters allows developers to modify the default behavior of a specific function. Functions used to filter data are called hooks. Filters and Actions together allow developers great flexibility to modify default WordPress filters and actions and even create their own custom filters and actions so that other developers can extend their plugins or themes.
Filters are different than Actions. WordPress actions are executed at events like when a theme or plugin is activated, or when a post is published. Filters are used to filter output when it is sent to either database or to user browser.
Example of using a WordPress filter
The sample code above adds a function
wpb_custom_excerpt to the filter
WordPress plugin API has an extensive list of filter hooks available in WordPress.