Theres actually a study on this [here](https://www.pnas.org/doi/full/10.1073/pnas.0611320104)
The length of a string paired with rate of agitation.. so shaking etc can create quite complex knots due to sheer probability
The longer a string gets the more likely it is.
Headphones are technically even worse because it is 2 seperate cables so the left and right cable can be tangled even faster..theres just a lot more chances a knot forms
Latest Answers