This example is contrived, but suppose we have
sqr x = x * x
inc x = x + 1
and we want to write a function that computes x^2+1. We can write
xSquaredPlusOne = inc . sqr
(which means
xSquaredPlusOne x = (inc . sqr) x
which means
xSquaredPlusOne x = inc(sqr x)
since f=inc and g=sqr).