What determines P/E

I was listening to an interview with Jeremy Grantham and he stated that two things determine p/e. Low inflation, and high profit margins correlate very closely with high p/e’s.