Anyway I'm wondering what causes spokes to break.
There are multiple reasons for that.
It all starts from improper wheel design. A properly designed wheel uses nearly tangential spokes that are flexible in their center sections and strong in their ends where they are most likely to break. Proper wheels usually have 36 spokes. In proper wheels, the spoke head is matched to the hub flange.
Unfortunately, it is all too common today to see wheels that do not have these design features.
A conventional size wheel with less than 36 spokes puts nearly all of its load on a single spoke, thus making spoke failure very likely. This use of less than 36 spokes also makes nipples unscrew. In an effort to not make nipples unscrew, some designers of improper wheels put thread glue into the threads (or it is possible this thread glue is added by the bike shop as a "quick fix" to apparently make an improper wheel work). Unfortunately, a wheel where spokes go completely slack is operating beyond its design limits and thus likely to fail. This problem is best avoided by insisting on wheels having 36 spokes.
In order to make wheel lacing fast (thus reducing the price of built wheels), hub makers have increased the size of spoke holes to be larger than necessary thus decreasing spoke lacing time. This has created a poor fit for spoke heads, especially if using the superior 1.8mm-1.6mm-1.8mm butted spokes. If building a wheel with these poor modern hubs, one should ideally select a 2.34mm-1.8mm-2.0mm triple butted spoke to better match the spoke head to the hub flange.
The most optimal spokes are butted spokes. They are more expensive, so most ready-built wheels save on costs and use straight gauge spokes. These straight gauge spokes are not as flexible, so the load is concentrated on a smaller number of spokes. This increases chances of spoke breakage.
The spokes should be laced in a nearly tangential manner, but it's unfortunately very common to see radially laced front wheels on front wheels for rim braked bicycles. These wheels lack the spoke crossings that distribute the spoke load to a pair of spokes, and also to prevent hub flange failure, tension on radially laced front wheels cannot be high.
Hub and rim design also play a role. Ideally a rim should be stiff, thus distributing the cyclic loads to a larger number of spokes causing lower peak loads. Disc brake hubs should have large enough flanges, torsionally stiff shaft and lots of spokes, but it's all too common to see hubs having too few spokes with flanges that are clearly too small for the spoke count. Good rims are also manufactured to a high tolerance, which is the enabler for even spoke tension (so the spoke tension doesn't have to fight rim irregularities by unevenness).
Then it is exaggerated by poor wheel building.
Ideally, wheels should:
- Be tensioned to an even and high tension. Unfortunately, many wheels lack both of these -- i.e. the tension is uneven and low on the average.
- Be stress relieved. Unfortunately, many wheels have not been stress relieved.
- Have corrected spoke line especially if using spokes that don't have a particularly thick head section. Unfortunately, cheap wheels may lack this correction of spoke line, thus causing the spoke to hang in thin air. This spoke line correction can be difficult with spokes being 2.34mm thick in their heads, but then again such thick-headed spokes work just fine without spoke line correction as an exception to the rule of needing to correct spoke line.
What finally causes the spoke to break is lots of hard miles. A cyclist who weighs a lot and carries a lot of load on panniers, riding tens if not hundreds of thousands of miles on the same wheels, in an aggressive manner (ride fast over bumps, brake hard, use relatively narrow tires pumped to huge pressures), causes the final breakage event. However, it all started from improper wheel design and was exaggerated by poor wheel building practices. A properly designed wheel, built by a master wheelbuilder, would be durable even if riding lots of hard miles.
And as a final note, historically materials used for making spokes were far worse. This has caused the author of the definite book on bicycle wheels, "The Bicycle Wheel" by Jobst Brandt, to discover what makes a wheel durable. We would not have the book in its present form if spokes had equally good materials 50 years ago.