From Angular documentation:
Detect and act upon changes that Angular can't or won't detect on its own.
Called during every change detection run, immediately after ngOnChanges and ngOnInit.
How this method can be called during every change detection run if angular can't or won't detect on its own?
Can somebody explain and give an example?
Angular calls it when change detection is run instead of or in addition to doing actual change detection of bindings in your component ("instead of" if change detection is disabled for your component) so you can do some custom checks or notifications in your custom code. You can check the source of
NgClass
orNgFor
for examples. Your custom change detection might be more efficient than Angulars default CD.