Why do some eggs crack while being boiled?
Well, sometimes eggs have non-visible (or non-visible without candling - shining a very bright light into the egg and looking at the light coming out of the egg) cracks.

That would be one possible cause - the crack pre-existed. Even if it was not cracked when graded, cracks both visible and invisible are possible in the distribution process.

Getting cracked from moving around in the pot is possible, depending on how hard you boil them. If actually boiling them I'd suggest a simmer, but in fact I don't suggest that at all - just boil the pot of water, lower eggs in with a spoon, turn the heat off and cover - yank when they suit your concept of "done" (if hard boiled, 20-30 minutes by this method.) "Coddling" is sometimes used to describe this, though it's also used to describe cooking (without shell, and possibly with added ingredients) in a specialized ceramic container (an egg coddler.) Anyway, it greatly reduces the odds of cracking via "rattling around in the pot" (though not why I do it that way; I do it because it appears, observationally, to reduce my incidence of overcooking the yolk and making it nasty.)