kali is a part of shiva,vision of shiva.if shiva is always meditating,kali is also meditating by destroying the evil forces.Both forces are same one is applying & one is giving the force by supportin.If one is suffering ,so other has to suffer too.Always shiva took step at last to stop kali's force.kali doesn't know where to stop until shiva lay down & when she put her leg on him then she felt her mistake & stopped.one orders so that the other one applies.Both are always thinking about the well being of others.How can one separate from each other when their soul is same their mind & vision is same.
Man has to happy what he get,he got it because of gods will & his own deeds knowingly or unknowingly.Kali also put leg unknowingly on shiva & realises her mistake that her job is finished means killing evil forces. so when ever there is evil force always kali & shiva's vision will take birth to destroy it. diwali is celebrated for good over evil.As ram also return to his kingdom after killing asuras.so festival of light is showing their is celebration after destroying evil forces.