Market anomaly
A market anomaly in a financial market is predictability that seems to be inconsistent with (typically risk-based) theories of asset prices.  Standard theories include the capital asset pricing model and the Fama-French Three Factor Model, but a lack of agreement among academics about the proper theory leads many to refer to anomalies without a reference to a benchmark theory (Daniel and Hirschleifer 2015 and Barberis 2018, for example).  Indeed, many academics simply refer to anomalies as "return predictors", avoiding the problem of defining a benchmark theory.

Academics have documented more than 150 return predictors (see List of Anomalies Documented in Academic Journals). These "anomalies", however, come with many caveats.  Almost all documented anomalies focus on illiquid, small stocks. Moreover, the studies do not account for trading costs.  As a result, many anomalies do not offer profits, despite the presence of predictability. Additionally, return predictability declines substantially after the publication of a predictor, and thus may not offer profits in the future.  Finally, return predictability may be due to cross-sectional or time-variation in risk, and thus does not necessarily provide a good investment opportunity.  Relatedly, return predictability by itself does not disprove the efficient market hypothesis, as one needs to show predictability over and above that implied by a particular model of risk.

The four primary explanations for market anomalies are (1) mispricing, (2) unmeasured risk, (3) limits to arbitrage, and (4)  selection bias.  Academics have not reached a consensus on the underlying cause, with prominent academics continuing to advocate for selection bias, mispricing, and risk-based theories.

Anomalies can be broadly categorized into time-series and cross-sectional anomalies.  Time-series anomalies refer to predictability in the aggregate stock market, such as the often-discussed Cyclically Adjusted Price-Earnings (CAPE) predictor.  These time-series predictors indicate times in which it is better to be invested in stocks vs a safe asset (such as Treasury bills).   Cross-sectional anomalies refer to the predictable out-performance of particular stocks relative to others.  For example, the well-known size anomaly refers to the fact that stocks with lower market capitalization tend to out-perform stocks with higher market capitalization in the future.

Explanations for Anomalies

Mispricing 
Many, if not most, of the papers which document anomalies attribute them to mispricing (Lakonishok, Shelifer, and Visny 1994, for example).  The mispricing explanation is natural, as anomalies are by definition deviations from a benchmark theory of asset prices.  "Mispricing" is then defined as the deviation relative to the benchmark.

The most common benchmark is the CAPM (Capital-Asset-Pricing Model).  The deviation from this theory is measured by a non-zero intercept in an estimated security market line.  This intercept is commonly denoted by the Greek letter alpha:

where  is the return on the anomaly, is the return on the risk-free rate, is the slope from regressing the anomaly's return on the market's return, and is the return on the "market", often proxied by the return on the CRSP index (an index of all publicly traded U.S. stocks).

The mispricing explanations are often contentious within academic finance, as academics do not agree on the proper benchmark theory (see Unmeasured Risk, below).  This disagreement is closely related to the "joint-hypothesis problem" of the efficient market hypothesis.

Unmeasured Risk 

Among academics, a common response to claims of mispricing was the idea that the anomaly captures a dimension of risk that is missing from the benchmark theory.  For example, the anomaly may generate expected returns beyond those measured using the CAPM regression because the time-series of its returns are correlated with labor income, which is not captured by standard proxies for the market return.

Perhaps the most well-known example of this unmeasured risk explanation is found in Fama and French's seminar paper on their 3-factor model: "if assets are priced rationally, variables that are related to average returns ... ..., must proxy for sensitivity to common (shared and thus undiversifiable) risk factors in returns.  The [3-factor model] time-series regressions give direct evidence on this issue."

The unmeasured risk explanation is closely related to the shortcomings of the CAPM as a theory of risk as well as shortcomings of empirical tests of the CAPM and related models.  Perhaps the most common critique of the CAPM is that it is derived in a single period setting, and thus is missing dynamic features like periods of high uncertainty.  In a more general setting, the CAPM typically implies multiple risk factors, as shown in Merton's Intertemporal CAPM theory.  Moreover, the ICAPM generally implies the expected returns vary over time, and thus time-series predictability is not clear evidence of mispricing.  Indeed, since the CAPM cannot at all capture dynamic expected returns, evidence of time-series predictability is less often regarded as mispricing as compared to cross-sectional predictability.

Empirical shortcomings primarily regard the difficulty in measuring wealth or marginal utility.  Theoretically, wealth includes not only stock market wealth, but also non-tradable wealth like private assets and future labor income.  In the consumption CAPM, (which is theoretically equivalent to Merton's ICAPM), the proper proxy for wealth is consumption, which is difficult to measure (Savov 2011, for example).

Despite the theoretical soundness of the unmeasured risk explanation, there is little consensus among academics about the proper risk model over and above the CAPM.  Propositions include the well-known Fama-French 3-Factor Model, Fama-French-Carhart 4-factor model, Fama-French 5-factor model, and Stambaugh and Yuan's 4-factor model. These models are all empirically-oriented, rather than derived from a formal theory of equilibrium like Merton's ICAPM.

Limits to Arbitrage 

Anomalies are almost always documented using closing prices from the CRSP dataset.  These prices do not reflect trading costs, which can prevent arbitrage and thus the elimination predictability.  Moreover, almost all anomalies are documented using equally-weighted portfolios, and thus require trading of illiquid (costly-to-trade) stocks.

The limits to arbitrage explanation can be thought of as a refinement of the mispricing framework.  A return pattern only offers profits if the returns it offers survives trading costs, and thus should not be considered mispricing unless trading costs are accounted for.

A large literature documents that trading costs greatly reduce anomaly returns.  This literature goes back to Stoll and Whaley (1983) and Ball, Kothari, and Shanken (1995).  A recent paper that studies dozens of anomalies finds that trading costs have a massive effect on the average anomaly (Novy-Marx and Velikov 2015).

Selection Bias 

The documented anomalies are likely the best performers from a much larger set of potential return predictors.   This selection creates a bias and implies that estimates of the profitability of anomalies is overstated.  This explanation for anomalies is also known as data snooping, p-hacking, data mining, and data dredging, and is closely related to the multiple comparisons problem.  Concerns about selection bias in anomalies goes back at least to Jensen and Bennington (1970).  

Most research on selection bias in market anomalies focuses on particular subsets of predictors.  For example, Sullivan, Timmermann, and White (2001) show that calendar-based anomalies are no longer significant after adjusting for selection bias.  A recent meta-analysis of the size premium shows that the reported estimates of the size premium are exaggerated twofold because of selection bias .

Research on selection bias for anomalies more generally is relatively limited and inconclusive.  McLean and Pontiff (2016) use an out-of-sample test to show that selection bias accounts for at most 26% of the typical anomaly's mean return during the sample period of the original publication.  To show this, they replicate almost 100 anomalies, and show that the average anomaly's return is only 26% smaller in the few years immediately after the end of the original samples.  As some of this decline may be due to investor learning effects, the 26% is an upper bound.  In contrast, Harvey, Liu, and Zhu (2016) adapt multiple testing adjustments from statistics such as the False Discovery Rate to asset pricing "factors".  They refer to a factor as any variable that helps explain the cross-section of expected returns, and thus include many anomalies in their study.  They find that multiple-testing statistics imply that factors with t-stats < 3.0 should not be considered statistically significant, and conclude that most published findings are likely false.

List of Anomalies Documented in Academic Journals