The function of a violin case is to protect the instrument from all sorts of 'dangers' that might impact on the health of the violin.
There are basically three threats:
1. Bumping/dropping the violin
2. Change in temperature
3. Change in humidity
Bumping against another object or dropping the violin is the most common cause for violin repairs. Violin cases protect against these threats by cushioning the violin within the case. Most modern cases cushion the violin very well. In olden times, cases were not as well designed, and the cushioning happened by first wrapping the violin into a silk cloth before closing the case.
These days many cases offer a soft but tight fit, whereby the violin is quasi-suspended off the bottom of the case. In most instances, the violin is placed on small cushions within the case. One cushion is below the top part of the violin's body, the other cushion is below the bottom part of the violin's body. A third cushion is often fixed above the chin rest. These shock-absorbing cushions keep the violin in a secured but 'suspended' position and this prevents damage to the violin during an impact to the case.