Consider an $M\times N$ image $f$ and an $G \times K$ filter $h$. Given that convolution in the spatial domain corresponds to multiplication in the Fourier domain, then we can perform a convolution of $f$ with $h$ (that is, we can filter image $f$ using filter $h$) by multiplying the Fourier transforms of $f$ and $h$, $\hat{f}* \hat{h}$, and then perform an inverse discrete Fourier transform of the result, $\hat{f}* \hat{h}$, where $\hat{f}$ and $\hat{h}$ are respectively the Fourier transform of image $f$ and kernel $h$.
However, to do that, we need to make sure that $\hat{f}$ and $\hat{h}$ have the same dimension. So, we use the zero padding technique. We pad both the image $f$ and $h$, before finding their Fourier transforms. More precisely, we pad each of them with zeros, such that their new size is $(M + G - 1) \times (N + K - 1)$. This padding is apparently required (for both $f$ and $h$), but I am trying to understand why.
Why exactly is this the case? I think it has something to do with the assumption that $f$ is periodic. So, the conclusion would be that we can't simply zero pad $h$ (without also zero padding $f$), but I don't get why.