Nummulites, a particularly abundant and diverse genus of larger benthonic foraminifera, formed huge accumulations (banks) during the Eocene, which are often good hydrocarbon reservoirs, especially in North Africa. Despite their economical interest, these accumulations are not well-understood and their origin is still under discussion. Reasons for this debate are the absence of living Nummulites accumulations and the high-variability of facies, including the size, shape and extension of the banks, which reflect the array of processes controlling sediment production and accumulation. The nummulitic banks near Santa María de Buil, in the Ainsa Basin (South Pyrenean Foreland Basin) are composed of recurrent facies associations within mappable bed units bounded by physical surfaces. The depositional processes that produced the Nummulites deshayesi accumulations are interpreted considering the shape of the banks, the type of bounding surfaces, the distribution of sedimentary textures, Nummulites test shapes and the associated skeletal components within the banks. This integrative analysis indicates that nummulitic banks accumulated from mass flows, with very poor sediment sorting. Textural and compositional differences among banks suggest that globose Nummulites thrived in the shallower part of the mesophotic zone with abundant nummulithoclasts, whereas flat nummulitic forms thrived in deeper mesophotic, clay-dominated settings. Interbedded with nummulitic banks, coral biostromes and coral mounds bearing Operculina, Discocyclina and Asterocyclina, represent in situ accumulation near the base of the photic zone. Internal waves (waves that propagate along the pycnocline) are thought to be the triggering mechanism for the density flows. Internal waves and induced bottom currents are sporadic but strong enough to bring sediments into suspension. In contrast to surface waves (both fair-weather and storm), whose impact is strongest near the sea surface and decreases with bathymetry, the impact of internal waves is usually strongest in the mid-shelf region and weaker in shallow water. This explains the compositional character of the nummulitic banks.