Selection bias occurs when the participants included in the study are not representative of the target population. This can happen due to non-random sampling, self-selection, or loss to follow-up in cohort studies. For example, if a study on the effects of smoking only includes hospital patients, the findings may not be generalizable to the broader population. Selection bias can distort the association between exposure and outcome, leading to erroneous conclusions.