I am reading the excellent book "Forecasting: Principles and Practice" and in chapter 7, section 5 there is the small section.
Beware of inference after selecting predictors
We do not discuss statistical inference of the predictors in this book (e.g., looking at p -values associated with each predictor). If you do wish to look at the statistical significance of the predictors, beware that any procedure involving selecting predictors first will invalidate the assumptions behind the p-values. The procedures we recommend for selecting predictors are helpful when the model is used for forecasting; they are not helpful if you wish to study the effect of any predictor on the forecast variable.
Would someone give a bit more detail on the bolded sentence (emphasis mine) above? Why would applying a procedure to select predictors, like AIC or BIC, invalidate the assumptions behind p-values?