Index funds may invest either in index components directly or in other instruments (like ETFs, index options, futures, etc.) which are highly correlated with the index. The specific fund prospectus or description on any decent financial site should contain these details.
Index funds are not actively managed, but that does not mean they aren't managed at all - if index changes and the fund includes specific stock, they would adjust the fund content. Of course, the downside of it is that selling off large amounts of certain stock (on its low point, since it's being excluded presumably because of its decline) and buying large amount of different stock (on its raising point) may have certain costs, which would cause the fund lag behind the index. Usually the difference is not overly large, but it exists.
Investing in the index contents directly involves more transactions - which the fund distributes between members, so it doesn't usually buy individually for each member but manages the portfolio in big chunks, which saves costs. Of course, the downside is that it can lag behind the index if it's volatile.
Also, in order to buy specific shares, you will have to shell out for a number of whole share prices - which for a big index may be a substantial sum and won't allow you much flexibility (like "I want to withdraw half of my investment in S&P 500") since you can't usually own 1/10 of a share. With index funds, the entry price is usually quite low and increments in which you can add or withdraw funds are low too.