Index funds are recommended for one who are not good in direct stock investing. so can not compare the returns with direct stock investing.
Yes Valuation matters, but some strong companies defy this for say 10/20/30 years. Take example of Pidilite which mostly trading >40 P/E, >8 P/B from last 15 years with >25% return. Identifying such companies is one part and patiently holding with ups/downs is another skill.
Another case : Rakesh jhunjhunwala and several other ACE investors bought Titan those days. But how many able to hold that today with patience and conviction.?
All these examples are small companies 15 years back. so they created wealth.
Some one with ability to enter & exit at right time based on valuation is an art and many can not do that. my perspective ,you can paly with Large well known stocks with this strategy as they typically will not grow too much and there are periods of opportunity, low risk , drawdowns are low.
where as small/micro & to some extent midcaps - you need to hold for long to create wealth.