A holdout that keeps time in order

A monthly series is split by taking a random subset of months as the test set and fitting on the rest.

Why does that split leak the future into the fit?

Consecutive months are not interchangeable rows. A random subset of months puts later months into the fit and earlier months into the test, or mixes them. The fit has then seen the future of the months it is asked to score. A holdout that keeps time in order fits on a past stretch only and scores a later stretch. Shuffling the months, or drawing them as if they were an independent sample, does not remove the dependence. The dependence has to stay inside the block that is held out.