Sum can do this “procedurally”, and the default method (Automatic) apparently does so when given the explicit summand. With the function form it only does the procedural when the number of terms is under a certain limit, by default 10^6. The two examples straddle this limit, hence the observed behavior. One can change this default as below.