Initially there was a concept of salary to be paid on a weekly basis to the workers in India, particularly the textile and flour mill workers in Bombay. So you received 52 salaries in a year.
But when British started ruling India they came up with concept of Monthly salary which meant you were getting paid for 48 weeks only.
So if we have 4 weeks in a month, 13 salaries should have been distributed but as per a monthly structure they were giving only 12 salaries in a year.
When people realized that this was a loss to them in terms of one salary many protest rallies were organised in Maharashtra during 1930-1940.
The British then came up with a solution to this problem. After discussion with labour leaders about how to distribute this 13th salary and they decided Diwali being the biggest festival of India, they would distribute this 13th salary durring Diwali. Today this is called the Diwali Bonus.
This was implemented from 30th June 1940.
This is the history behind the Diwali Bonus.