If I understand it correctly, the Euler-Maclaurin summation formula states that for a periodic and infinitely differentiable function, the error of the trapezoidal rule of the numerical integration of the function over an integer multiple of the period is $$\epsilon = \sum_{k=1}^\infty\frac{B_{2k}}{(2k)!}\left(f^{(2k-1)}(b)-f^{(2k-1)}(a)\right)=0$$ because the upper limit $b$ and lower limit $a$ of the integration differs by an integer multiple of the period.
My question is how can it be true without any requirement on the number of points used in trapezodal rule at all (since this number does not appear in the formula)?
Take the simplest example of using two points only, i.e., $a$ and $b$. There are infinitely many different periodic functions with period $b - a$ and with different values of the definite integral from $a$ to $b$. How could the answer always be $\frac{b-a}{2}\left(f(a)+f(b)\right)$?
The more general question is that the trapezoidal rule computes the function value at some discrete points inside $[a,b]$, and a periodic function can behave in any ways between these discrete points, so why can the trapezoidal rule always give the exact value of the integral?