Why stock prices rise

Is the long-term rise in stock prices linked to economic growth or inflation?