I wouldn't exactly call it voluntary. For one thing, Qu'ran is pretty harsh on people who refuse to pay it when they have the means, to the point of calling such munafiq. For another, a state-administered system of collecting it (which was not voluntary) was in place from a very early time, since the second Caliph.
But, yes, the original intent was charity, and specifically a form of guaranteed basic income.
With jizya, yes, it was positioned as a monetary compensation for lack of armed service. On the other hand, the reason why armed service was not expected was also telling: non-Muslims were prohibited from owning and bearing weapons in general.