Each bootstrap sample has the same size as the original data and is drawn from it with replacement, so some points appear several times and others not at all. The idea is that the sample stands in for the population. Bradley Efron introduced the method in 1979, and it made intervals possible for statistics with no simple formula, such as a median, a ratio or a model's AUC.
Example: ten order values, 12, 15, 9, 22, 30, 11, 14, 18, 95 and 16, have a median of 15.5. Resampling them 10,000 times and taking the 2.5th and 97.5th percentiles of the resampled medians gives a 95% interval of about 12 to 24. Each resample leaves out (1 − 1/10)¹⁰ ≈ 35% of the original points, approaching 1/e ≈ 37% for large samples, which is where a random forest's out-of-bag rows come from.
Limits: the bootstrap assumes independent observations, so time series need a block bootstrap that resamples runs of consecutive points; it does poorly for extremes such as a maximum; and with very small samples it can only reproduce what little the data show. In machine learning, bagging trains one model on each bootstrap sample.