You can estimate the earnings yield you get on a business based on its price. So, if you have a lemonade stand that earns $100 per year, and you buy it for $100, that’s a great price. You’ll make your money back in a year. After that it’s profit, baby! If you pay $100000, it’ll take 1000 years to earn back your original investment in nominal terms. But it still might be an OK investment, if you are very certain that you can double earnings every year for long enough.
That’s basically how you evaluate what to pay for a company. When you buy stocks, you buy fractional ownership in a company.
Edit: many think the market is overvalued, because it’s currently at historically high price relative to the estimated earnings potential. This, while risk of insolvency for many companies is much higher.