A backtest applies fixed rules to past prices and reports the result. Done honestly it is the cheapest way to reject a bad idea before risking capital on it.
Most backtests are optimistic for structural reasons. Survivorship bias omits the companies that delisted, lookahead bias uses data that was not available at the time, and assumed fills ignore spread, slippage and commission, each of which quietly adds return.
Overfitting is the deeper problem. Enough parameters tuned on one dataset will describe its noise perfectly and predict nothing, which is why out-of-sample testing on data never used during development is the only result worth much.