After the second world war England became a poor country not capable of ruling a big country like India and wanted to get to rid of the unnecessary burden as Indian resources had been already looted. That is why they gave freedom and it is not because of any so called struggle by Gandhi.