The two meanings are related as being kind to the people in need and helping them causes one’s soul to grow and get purified from greed and stinginess.
In the Quran, too, Zakat in some verses means purity, including Verse 13 of Surah Maryam:
“We gave him compassion and purity. He was a pious human being.”
In some other verses, it refers to both Wajib (obligatory) and Mustahab (recommended) donation of wealth to the needy.
Read More: