Earnings just means the company's yearly profit, and the P/E ratio is the share price divided by that profit per share. It is the quickest way to gauge how expensive a stock is. Think of buying a whole business: if it earns $10,000 a year and you pay $200,000 for it, that is a P/E of 20, because the price is 20 times its yearly profit, and it would take roughly 20 years of those profits to earn your money back.
Flip the same numbers around and you get the earnings yield: $10,000 of profit on a $200,000 price is 5% a year. So a P/E of 20 is a 5% yield, and a P/E of 10 is a 10% yield. It is the same fact seen two ways, and the rule is simple: a lower P/E means a cheaper stock that earns back more for you each year relative to what you paid.
But P/E on its own can mislead. A low P/E can hide a business that is quietly falling apart, while a high P/E can still be a bargain if the company is growing fast enough to grow into it. So never read it in isolation. Compare it across the company's own good and bad years, against others in the same industry, and alongside return on equity and free cash flow yield for the full picture.