When it comes to cash, Zakat is simply paid on the residual cash left over on one's Zakat anniversary.
So it is irrelevant whether one earns money from salary, investments, benefits, gifts etc. One should simply fix a Zakat anniversary on a date in the Islamic calendar and then pay Zakat on whatever cash they have on the day, plus anything else that qualifies for Zakat.