  Let $G \subset \mathbb{C}^2$ be a smoothly bounded pseudoconvex domain and
assume that the Bergman kernel of $G$ is algebraic of degree $d$. We show that
the boundary $\partial G $ is of finite type and the type $r$ satisfies $r\leq
2d$. The inequality is optimal as equality holds for the egg domains
$\{|z|^2+|w|^{2s}<1\},$ $s \in \mathbb{Z}_+$, by D'Angelo's explicit formula
for their Bergman kernels. Our results imply, in particular, that a smoothly
bounded pseudoconvex domain $G \subset \mathbb{C}^2$ cannot have rational
Bergman kernel unless it is strongly pseudoconvex and biholomorphic to the unit
ball by a rational map. Furthermore, we show that if the Bergman kernel of $G$
is rational of the form $\frac{p}{q}$, reduced to lowest degrees, then its
rational degree $\max\{\text{deg } p, \text{deg } q \}\geq 6$. Equality is
achieved if and only if $G$ is biholomorphic to the unit ball by a complex
affine transformation of $\mathbb{C}^2$.
