The callback mechanism offers the user an event-driven system for windows and window objects (widgets). For almost any event which might occur (touch input, drawing, key input, etc.) the window manager decides which window is affected (e.g. touch input inside a window area) and send a message to this window. Inside the callback function the user can react on this messages and decide what should happen. For example, if the window becomes invalid, the window manager sends a paint message (WM_PAINT) to the invalid window for triggering a repaint. Now the customer can react on this paint message an call the proper drawing functions to define the look of this window.
This mechanism allows allows the user to have the full control over the behavior and the look of every window. This can be easily achieved by setting an own callback function.
With the window Manager are coming widgets (window objects) which provide the user a wide range of objects such as button, progress bar, edit box, spinbox, etc. These widgets are windows with a pre-defined behavior (e.g. a button reacts on touch input). Since widgets are still window they can be configured as much as a normal window, simply by overwriting/setting an own callback.