There's as I see it a big difference between charity and CSR. Charity & CSR are two completely different concepts, but are unfortunately often mixed together and used simultaneously.
Charity is about doing something for free. E.g. as a company you give your old IT systems to a school, you give a certain amount of money to a local orphanage etc.
CSR is much more complex and let's say more difficult to implement for a company. CSR should preferably be linked up to the core business of the company in the sense that while doing good for the society, the company is actually doing well.
An example from India could be Max Vidaya from Max New York Life. Other (maybe better) examples are Amul (their BOP attitude) and Tata Industries (their work on climate and sustainability
If a NGO and a company builds a partnership around some kind of non-profit project, this can be seen as CSR as well. But it must be seen as a 'win-win partnership', that benefits both partners and the society.
CSR is NOT branding, marketing etc., but can be seen more as a proper business opportunity.
While charity is often used in relation to marketing and branding.