The top of the chain, the code generating the output, is typically called a "content generator." The content generator's output is fed into the filter chain using the standard Apache output mechanisms: ap_rputs(), ap_rprintf(), ap_rwrite(), etc.
Each filter is defined by a callback. This callback takes the output from the previous filter (or the content generator if there is no previous filter), operates on it, and passes the result to the next filter in the chain. This pass-off is performed using the ap_fc_* functions, such as ap_fc_puts(), ap_fc_printf(), ap_fc_write(), etc.
When content generation is complete, the system will pass an "end of stream" marker into the filter chain. The filters will use this to flush out any internal state and to detect incomplete syntax (for example, an unterminated SSI directive).