Let $\mathcal L(\phi,\partial\phi)$ be a Lagrangian for a field $\phi$. It is known that the Lagrangian $\mathcal L$ and the Lagrangian $\mathcal L+\partial_\mu K^\mu$ produces the same physics, provided that $K$ depends on spacetime points through $\phi$ and $x$ only (eg. not through $\partial\phi$).
This can be seen because if the divergence term is varied, we get $$ \int_{\partial\mathcal D}d\sigma_\mu\delta K^\mu=\int_{\partial\mathcal D}d\sigma_\mu\left(\frac{\partial K^\mu}{\partial\phi}\delta\phi+\frac{\partial K^\mu}{\partial\phi_{,\mu}}\delta\phi_{,\mu}\right), $$ where I have assumed that $K$ also depends on $\phi_{,\mu}$. If only the first term was present in the brackets, then because $\delta\phi|_{\partial\mathcal D}=0$, the variation of this term would vanish. However because of the term proportional to $\delta\phi_{,\mu}$, this is no longer true.
On the other hand, if we consider invariance of a Lagrangian under spacetime-translations, because the Lagrangian is a scalar (at least in SR), under the transformation $x^\mu\mapsto x^\mu+\epsilon a^\mu$ it gets varied to $$ \delta \mathcal L=a^\mu\partial_\mu\mathcal L=\partial_\mu(a^\mu\mathcal L). $$ So in this case, $$ K^\mu=a^\mu\mathcal L, $$ but $\mathcal L$ depends on $\partial\phi$, so by the things said in the first part of this post, this is not a good $K^\mu$.
How to resolve this?
EDIT: Upon rereading my post, I realize I have been a bit too brief. To contextualize this better, a variation is a symmetry of the action if the Lagrangian gets varied to $\delta\mathcal L=\partial_\mu K^\mu$. This is a symmetry because of what I said in the first part.
This is utilized in the derivation of the canonical SEM tensor, as translations provide a symmetry of the Lagrangian because it gets varied to $\partial_\mu (a^\mu\mathcal L)$.