Though probably it is possible to do both. I suspect there are many modern charities that help people become self sufficient where neither the donors not the recipients know who each other are.
Disclaimer: IANAR (I am not a Rabbi)
Jewish law prohibits lending with interest. There are many ways around that but Maimonides here is referring to a basic non-interest loan
(btw, I made that description up to try and describe the kinds of states I'm referring to. e.g. the USA once was in that category and no longer is in my view, while many European countries probably are in that category).
EDIT: I'd like to point out, I'm assuming no/little corruption. i.e. the theoretical view of such a state.
Personally, I live in such a state (not the US), that has a safety net, and am happy to contribute via taxation. Not all my fellow citizens are happy to contribute and I accept that. I earn a decent wage and don't jump through hoops to minimise my tax. At the end of the day, people vote for governments that are more or less taxing.