An index fund buys every company in an index (the S&P 500, the MSCI World, whichever it tracks) in the weights that index specifies, and then makes no further decisions. There is no manager selecting stocks, which is why the cost is a fraction of an active fund's.

The reason this works is not that indexing is clever but that it is arithmetically hard to beat. All investors together are the market; the average return before costs is the market's, and after costs it is the market's minus fees. A product charging 0.20% starts with a structural advantage over one charging 1.50%, and that advantage compounds year after year.

What an index fund does not do is protect you from falls: if the index drops 35%, your fund drops 35%. Its edge is cost and breadth, not stability.