The sum you wrote approximates an actual integral:
\begin{align}
\langle \sum_k \phi(\lambda_k)E(\Delta\lambda_k)x,y\rangle
& = \sum_k\phi(\lambda_k)\langle E(\Delta\lambda_k)x,y\rangle \\
& \approx \int \phi(\lambda)d_{\lambda}\langle E(\lambda)x,y\rangle.
\end{align}
And the complex integral on the far right is sesquilinear form that can be used to define a unique operator $``\int \phi(\lambda)dE(\lambda)''$ as the unique operator satisfying
$$
\int \phi(\lambda)d_{\lambda}\langle E(\lambda)x,y\rangle = \left\langle \int \phi(\lambda)dE(\lambda)x,y\right\rangle,\;\;\; x,y\in H.
$$
Such an operator exists because the left side is a bounded sesquilinear form on the Hilbert space. If $E$ is a spectral measure associated with a selfadjoint operator $A$, then $A=\int \lambda dE(\lambda)$, and $A^n = \int \lambda^n dE(\lambda)$ for $n=1,2,3,\cdots$. So the spectral integral represents a function of the operator $A$. For example $e^{A} = \int e^{\lambda}dE(\lambda)$. The rough idea is that $dE(\lambda)$ is the projection onto the part of the space associated with spectral component $\lambda$. That is, $AdE(\lambda)=\lambda dE(\lambda)$. For a selfadjoint with discrete spectrum, such as a matrix on a finite-dimensional space, the measure $E$ has discrete support that is equal to the set of eigenvalues of $A$, and $E(\{\lambda\})$ is the projection onto the eigenspace associated with eigenvalue $\lambda$ of $A$, i.e., $AE\{\lambda\}=\lambda E\{\lambda\}$ is exact. The general case of a selfadjoint operator is well-approximated by an operator with discrete spectrum, even if it has no actual eigenvalues, and this is how the Riemann-Stieltjes sum comes into play to approximate the general by the discrete case.