As you almost undoubtedly understand, it would happen if the earnings dropped by a bigger percentage than the stock price.
Here are a couple of ways that could happen.
(1) A company's manufacturing capability is temporarily reduced due to a disaster, such as a tornado or a flood. That will have a severe impact on quarterly earnings, but little if any impact on the ability of the company make money in the future. So, earnings might drop 50% for a quarter but the stock price might only drop 20%, resulting in an increase in the P/E ratio.
(2) A company has a stock price of $200 and decides to have a 4:1 stock split. Investors in the company generally approve of split, so after the split the stock sells for $60. Earnings per share dropped a full 75%, but the stock price only dropped 70%, so the P/E ratio would increase.
You should also be aware that some researchers publish a an estimate of the future P/E of a company based on their estimates of what will happen in the future, not actual current data.