Excerpts from the book Divine Intimacy by Father Gabriel of St. Mary Magdalen, O.C.D. (section 153 on aridity):
"At the beginning of a more intense spiritual life the soul usually enjoys a sensible fervor which makes spiriual exercises easy and agreeable … However, this state does not ordinarily last long, and there comes a time when the soul is deprived of all sensible consolation. This suppression of sensible devotion is the state of aridity, which may have various causes.
"Sometimes it is the result of infidelity on the part of those who little by little have become lax, allowing themselves many slight satisfactions and pleasures and giving in to their curiosity, selfishness, or pride … If they only realized what benefits they were losing by such conduct, they would be ready for any kind of sacrifice rather than yield to these weaknesses … The unfaithful one who has fallen back into mediocrity cannot protest to the Lord in prayer that it loves Him and desires to advance in His love … Hence such a soul inevitably falls into aridity. In this condition the only remedy is to return to its first fervor … Our Lord loves so much to forgive!
"On the other hand, aridity sometimes arises from physical or moral causes which are entirely independent of ourselves: indisposition, illness, fatigue, or depression … It is a trial which may last a long time, but one in which we must, with good reason, see the hand of God which disposes everything for our good, and realize that He cannot fail to give us the grace necessary to proft by our suffering …
“If, in spite of everything, the soul does not succeed in moving its heart, let it love God by the will alone. This requires a great effort, but by it this faculty is strengthened. Almost withot realizing it, the soul is made capable of a more active, generous love. This love will be deprived of feeling, it is true, but we must remember that the substance of love does ot consist in feeling, but in willing to give pleasure, at any cost, to the person loved …”
The short answer to your question: in a saintly person, it is probably God’s way of purifying our love, so that we love Him for Himself, not for the feelings it produces. In a sinful person, we can safely assume that darkness or aridity is a result of our sinfulness.