We analyze ESG-based investments in stocks across 23 developed markets using daily data from 2004 to 2022. The findings suggest a weak relationship between the ESG ratings and expected returns, with some evidence of modest underperformance of high ESG stocks compared to lower-rated ones in specific periods. This outcome indicates that stock prices have already reflected ESG information, and well-known asset pricing factors can effectively capture the returns of portfolios based on ESG ratings. However, the strength of this relationship depends on global attention to sustainability, where high ESG-rated stocks tend to gain advantages during unexpected attention increases, highlighting the dynamic, nonlinear nature of this relationship.