Why does atrial fibrillation cause strokes?

Standstill. The extremely rapid rates of atrial fibrillation are in fact so fast that they create two problems: the top chamber is not mechanically moving very far at all, so it cannot shake clots loose, in the overactive atrial tissue secretes chemicals which increase the likelihood of clot formation. These processes come together to substantially increase stroke risk.
Clot formation. Because blood in the left atrium is not propelled forward normally during atiral fibrillation, it allows for the formation of clots. Small areas of blood pooling resembling little eddy currents allow blood to slow down and form clots. If one of these clots is then propelled forward it can travel to the brain, become lodged in a blood vessel and cause a stroke. A clot the size of a pinhead can do it.