Let us consider the case when the centre acts trivially, for simplicity. Let us call $H_p$ to be the polynomial algebra generated by the classical Hecke operators $\{T_{p^r}\mid r\ge 0\}$. Using the Hecke multiplicativity relations one can say that $H_p$ is a polynomial algebra generated by $T_p$. Let $K_p:=\mathrm{PGL}_2(\mathbb{Z}_p)$ and $G_p:=\mathrm{PGL}_2(\mathbb{Q}_p)$ Consider the map
$$\varphi: \mathcal{H}(K_p\backslash G_p/K_p)\to H_p,$$
$$S_p:=\frac{1}{\mathrm{Vol}(K_p\begin{pmatrix}p&\\ &1\end{pmatrix}K_p)}\mathrm{Char}_{K_p\begin{pmatrix}p&\\ &1\end{pmatrix}K_p}\mapsto T_p.$$
By a theorem of Satake $S_p$ generates $\mathcal{H}$ polynomially, and $\varphi$ is an algebra isomorphism. Using elementary divisor theorem it is not very difficult to find preimage of $T_{p^r}$ under $\varphi$, as well.
To have more geometric understanding you may think $G_p/K_p$ as a $p+1$-regular tree. One can find a coset representatives of $K_p\begin{pmatrix}p&\\ &1\end{pmatrix}K_p\bigg/K_p$ to be
$$\{\begin{pmatrix}1&b\\ &p\end{pmatrix}\mid b\in \mathbb{Z}/p\mathbb{Z},\begin{pmatrix}p&\\ &1\end{pmatrix}\}.$$
These cosets correspond to the $p+1$ branches of the identity in the tree, and then $S_p$ can be thought as an averaging operator over these branches. If you recall the definition of the classical Hecke operator $T_p$ on the upper half plane, say at a point $z$, you will see that that also averages over the points
$$\{\begin{pmatrix}1&b\\ &p\end{pmatrix}.z\mid b=0,\dots,p-1,\begin{pmatrix}p&\\ &1\end{pmatrix}.z\}.$$
Hope this describes the connection between two descriptions of the $p$-adic Hecke algebra.