Stock indices, such as those provided by stock exchanges or financial institutions, serve as a reference to track average stock prices and help investors gauge market trends, manage risks, and assess investment performance in real-time.