Transimpedance amplifier transfer function
Consider that every amplifier has a voltage noise source (\$e_n\$) associated with the inputs. Here is one realization of how that may be analysed: -



So, if the feedback capacitor were not there and you calculated how much output noise the op-amp would produce (due to \$e_n\$), you would see that at some frequency (\$R_g/X_c\$) the output noise would start to rise.

For the perspective of the noise source (\$e_n\$), noise gain is: -

\$1+ \dfrac{R_g}{X_c}\$   and, as \$X_c\$ gets smaller, output noise rises to a maximum.

This is why \$C_f\$ is used - it tries to counter the noise effects by shunting \$R_g\$.