I don’t think there has ever been much systematic study of this, but rather, just anecdotal.
Most clergy and parishes know why people go irregularly, as have been mentioned throughout the thread (cultural reasons, going with family they are visiting, fond memories, get something special at Mass [ashes, palms, throat blessing, calendar]).
Studying it in a scientific fashion would be difficult - asking those attending to fill out a card would take more time than people would tolerate, and the responses by those who attend occasionally would likely not be terribly honest.
It is what it is, other religions have the same issue: lots of Jews attend on the High Holy Days, and rarely ever during the rest of the year. Protestants have swelled numbers at Christmas and Easter. The same is true of Orthodox Christians. More Muslims go to mosque during Ramadan, etc.
Better to have them with us than not, and scolding them (even if they incorrectly perceive they are being scolded), does not bring them back any sooner.
The laborer who worked just an hour received the same wage as the one who worked all day - Jesus is full of mercy.
Many Catholics become more engaged as they approach death. Let’s all pray for those who come to Church rarely.
Deacon Christopher