For centuries the only real organisations were the nobility, military (and by proxy the state) and the church. There wasn’t much philanthropy from the medieval landowners so it fell to the church to stop people falling through the gaps.
Since the 19th Century there have been many more philanthropic organisations and charities popping up until the 21st Century where is often seems like charities are the ones picking up the pieces whilst the mainstream church busies itself with telling people how not to live.
This is a gross generalisation of course as there are many churches that do still do as love asks of them, countries where the state picks up the slack and indeed the church hasn’t really stopped telling people they’re doing it wrong since the reformation. Here in the UK the radical military dictatorship set up after the English Civil War once banned Christmas and indeed the law forbidding people from eating mince pies on Christmas Day has never been rescinded! (But it is never enforced)
I sound incredibly negative about things but I thoroughly recommend reading ‘Irresistible’ by Andy Stanley for what the church should really be about.
https://www.amazon.com/Irresistible-Andy-Stanley/dp/0310536987/ref=asc_df_0310536987/?tag=googshopuk-21&linkCode=df0&hvadid=310820990134&hvpos=&hvnetw=g&hvrand=6161298836461548102&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9046357&hvtargid=pla-527000674236&psc=1&th=1&psc=1