As @skoestlmeier and @noob2 commented there's much research going on about the profitability anomaly.
Firstly, there are different ways of measuring profitability. Novy-Marx (2013, JFE) uses gross profitability, Fama and French (2015, JFE) total profitability and Hou et al. (2015, RFS) return on equity. The $q$-theory model from Hou et al. claims to explain momentum with its profitability factor.
So, what could be a risk-based explanation for profitability? Different explanations have been proposed. I present two arguments here using real options asset pricing. In that stream of the literature an idealised firm uses production and investment decisions (``real options'') optimally as to maximise its value. The riskiness of these options then equates to the firm's systematic risk. This way, you obtain a neoclassical, risk-based explanation for many cross-sectional anomalies. For example, there exist models which can explain, amongst others, momentum, size, value, investment and profitability effects.
I present results from two papers here.
- Bali, del Viva, Lambertides, and Trigeorgis (2019, JFQA)
The authors argue that profitable stocks are mostly invested in cash-generating assets-in-place and own only few growth options. Zhang (2005, JF) explains how assets-in-place are riskier than growth options to rationalise the value premium: assets-in-place have high adjustment costs and a countercyclical price of risk. In plain English, growth options are much more flexible and thus less risky. As a result, the larger the proportion of assets-in-place compared to the proportion of growth options, the risker the firm.
Bali et al. further argue that growth options induce more skewness to the returns of the firm because the payoff of (growth) options is convex. They then estimate expected growth option induced idiosyncratic skewness and construct a factor based on this variable. Here's a part of Table 4 from their paper:
As you see in column 1, the higher profitability (measured as return on equity), the higher returns and indeed, the spread portfolio has a significant return after adjusting for risk from market, size, value, momentum and liquidity. However, in the last row, when including the future idiosyncratic by growth options induced skewness factor (FISKEW$_\mathrm{GO}$), the alpha vanishes and is statistically indistinguishable from zero. As it happens, the same is true for three further anomalies based on distress, lottery and idiosyncratic volatility.
- Aretz and Pope (2018, JF)
Unlike Bali et al., Aretz and Pope provide a theoretical, partial equilibrium model which features a variable called ``capacity overhang'', which is the difference between installed capacity and optimal capacity (optimal capacity being the capacity maximising the net firm value). Using a stochastic frontier model, the authors estimate firm-wise capacity overhang every month and find that it, unsurprisingly, relates negatively to stock returns. Furthermore, the variable helps explaining momentum and profitability but not value or investment. Here's a part of Table 7 from their paper.
You can see the results of Fama-MacBeth (1973) regressions (all regressions presented here include unreported constants and controls). Panel A confirms that capacity overhang relates negatively to stock returns. Panel B confirms that the anomalous behaviour of various momentum and profitability variables. Most importantly, Panel C demonstrates that capacity overhang helps explaining momentum and profitability. Look at columns ''Operating Profit'' and ''Profit''. Both variables have a positive and statistically significant impact on returns (Panel B) but are rendered insignificant when including capacity overhang.
As you see, here are two recent papers which provide empirical evidence how profitability effects can emerge from a neoclassical setting in which rational firms maximise their value. This is fully in line with efficient markets. Of course, there are other potential explanations, including behavioural arguments. The jury is still out on which approach is the correct one.