Both explanations are partly true.
There are many investors who do not want to sell an asset at a loss. This causes "resistance" at prices where large amounts of the asset were previously traded by such investors. It also explains why a "break-through" of such a "resistance" is often associated with a substantial "move" in price.
There are also many investors who have "stop-loss" or "trailing stop-loss" "limit orders" in effect. These investors will automatically sell out of a long position (or buy out of a short position) if the price drops (or rises) by a certain percentage (typically 8% - 10%).
There are periods of time when money is flowing into an asset or asset class. This could be due to a large investor trying to quietly purchase the asset in a way that avoids raising the price earlier than necessary. Or perhaps a large investor is dollar-cost-averaging. Or perhaps a legal mandate for a category of investors has changed, and they need to rebalance their portfolios. This rebalancing is likely to take place over time. Or perhaps there is a fad where many small investors (at various times) decide to increase (or decrease) their stake in an asset class. Or perhaps (for demographic reasons) the number of investors in a particular situation is increasing, so there are more investors who want to make particular investments. All of these phenomena can be summarized by the word "momentum".
Traders who use technical analysis (including most day traders and algorithmic speculators) are aware of these phenomena. They are therefore more likely to purchase (or sell, or short) an asset shortly after one of their "buy signals" or "sell signals" is triggered. This reinforces the phenomena.
There are also poorly-understood long-term cycles that affect business fundamentals and/or the politics that constrain business activity. For example:
- The sun has multi-year cycles (called "sunspot cycles") that affect the weather -- and thus farming and other economic activity.
- The oceans have multi-year cycles that also affect the weather.
- Regularly scheduled elections in two-party countries result in alternating government policies.
- The first world is seeing demographic waves. The most noted effect is the alternation of births of descendents of people born in during 1930-1944 vs. 1945-1960.
Note that even if the markets really were a random walk, it would still be profitable (and risk-reducing) to perform dollar-cost-averaging when buying into a position, and also perform averaging when selling out of a position. But this means that recent investor behavior can be used to predict the near-future behavior of investors, which justifies technical analysis.