I am an archaeologist and I specialize in the ancient Maya. Here's how it happens:
1: The vast majority of ancient Maya buildings are built using a "core and veneer" technique. The bulk of the building's volume is earth and stone rubble, faced with a veneer of nicely-shaped limestone blocks that are themselves covered by a layer of lime plaster (stucco). The geology of the Yucatan peninsula is almost entirely limestone, so they built with what they had available.
2: Most pyramids have multiple construction phases, with each one adding a new layer of rubble/earthen core and cut stone and stucco veneer. The building gets bigger with each renovation.
3: Following abandonment, strong seasonal rains quickly erode the lime stucco on much of the outermost layer. This eroded stucco is chemically and structurally identical to the eroded bedrock that underlies natural soils in the Maya region, meaning that plants can readily grow on it.
4: The limestone used for cut stone veneers is itself really porous and prone to crack, pit, and erode in most parts of the Maya lowlands. I am constantly seeing small trees growing out of ostensibly solid blocks of limestone--their roots can still get plenty of purchase. As such, trees can easily take hold in the space between blocks and in small imperfections in the stones themselves.
5: As the trees grow (and especially as their roots push or pry out loosened veneer stones), the cut stones from the veneer give way, exposing the earthen/rubble core underneath.
6: Other posters are correct that some topsoil builds up as a result of wind-transported dust and decaying plant matter, but this is a very, very small amount, especially on the steeper upper portion of the building (remember, the buildings become less steep overall as they erode, because what had been on the upper part tumbles down and piles up around the base, reducing the gradient). Instead, most of the "soil" was actually put there by the Maya as part of the final construction phase, covered by a layer of modern humus.
7: It follows that in many parts of the Maya world, what you see when you look at a cleared/restored pyramid is not really what it looked like in its final stage. Instead, it's usually a mix of the last and second-to-last construction phases, both having been subject to varying degrees of erosion, with the last phase usually only preserved toward the bottom and at the very top.