Earbud cords form coils in your pocket. Even if you crumple the cord, it eventually finds its way into coils as you move and the cord is agitated. The coils lie in planes that are stacked.
It's been found that agitated coils spontaneously braid and knot themselves. See this paper: http://www.pnas.org/content/104/42/16432.full, which found that formation of knots in an agitated string is dependent on (1) the agitation time, (2) the length of the string, (3) the type of agitation, and (3) the stiffness of the string. A long, flexible string tends toward theoretical predictions of knotting, whereas a stiff string resists self-knotting.
Flat earbud cords are extremely stiff on two of their four faces. They do not bend easily through the narrow faces. Only the wide faces can easily bend. The wide surfaces fold, but they resist bending in other directions, across their narrow sides. Also, they resist twisting, and will only twist in a corkscrew with a relatively wide radius. Think of a flat cord lying in a coil in the x,y plane. With its wide faces perpendicular to the plane, but parallel to the z axis, the flat cords exhibit stiffness along the z axis, and resistance to leaving the x,y plane. In order to self-braid, the cord would need to flex above and below the x,y plane. Their shape resists this.
Round cords, on the other hand, bend and twist in all directions, so there is little resistance to the loops of a coil flattening into ellipses of various major and minor axes which then shift lateral position and send bights above and below the planes of other ellipses. They have equal flexibility in all three planes, so their propensity to self-braid by sending loops above and below the x,y plane is uninhibited.
Some manufacturers have reduced self-braiding and self-knotting by stiffening their round earbud cords. But early models were notoriously flimsy, and braided with very little agitation.