Was quantum mechanics made to fit the Bell violations or they just happen to fit them? Entangled bipartite states can violate the CHSH inequality by up to $2\sqrt{2}$ with suitable measurements. Is it that in nature we don't witness violation of CHSH more than this and quantum mechanics explains this violation correctly? Or is it that quantum mechanics (states being in superposition, entanglement etc) was formulated so as to incorporate the Bell violations correctly?
 A: It's not completely clear what you're asking, but I can make one thing clear:

quantum mechanics was not developed with the specific aim of correctly describing the precise amounts to which CHSH inequalities can be violated.

Quantum mechanics was developed in the 1920s and early 30s. Bell published his first paper on Bell inequalities in 1964. The first experiments testing the inequalities were published in 1972, though they suffered from problems (known as "loopholes") which mean it's not quite possible to match the assumptions of Bell's theorem to the experimental situation. (Completely loophole-free Bell tests are still some way in the future now a thing.)
It is at present an open question whether the amount by which the CHSH inequality can be broken in a loophole-free Bell test exactly matches the predictions of quantum mechanics, although all experiments to date are consistent with this conclusion. An experiment which showed a violation above and beyond the predictions of quantum mechanics would be of the utmost interest.
Quantum mechanics was developed to describe the dynamics of interactions of electrons, atoms, and radiation at the atomic and molecular level. Its key elements (de Broglie's wave-particle correspondence, Schrödinger's equation as a way of providing a mechanics for the new matter waves, Born's rule as a way of interpreting the Schrödinger wavefunction) were developed to try and explain atomic and radiation phenomena which were not explainable by classical mechanics. Their success, from the energetic spectrum of the hydrogen atom onwards, confirmed that this was a productive way to think about nature. We have yet to find an experiment which is clearly unexplainable by quantum mechanics (try as we might).
The fact that the predictions of quantum mechanics match (within experimental uncertainty) the experimental results in the new, unexpected area that is CHSH violations is yet another confidence-building piece of evidence that quantum mechanics is 'right' in some sense.

Finally, one of your comments betrays a misconception, i.e.

Bell inequalities are just a mathematical result one gets from the theory of quantum mechanics.

Bell inequalities by themselves have fairly little to do with quantum mechanics. Inequalities such as the CHSH one provide bounds on the types and amounts of correlations one might observe in isolated systems if one assumes that nature is 'local' and 'realistic' (in a precise technical sense), independently of what mechanics nature actually obeys.
Say I have two boxes, $A$ and $B$. I allow them to interact at some initial moment and then I separate them and perform an experiment on them. There are multiple ways in which the outcomes can be correlated.


*

*If the boxes can communicate superluminally, then they can always be as correlated as they wish.

*If the boxes are allowed any form of nonlocal 'interaction' as long as it provably cannot be used to communicate, this restricts the amount of correlation that they can show.

*If the boxes are further restricted to contain strictly local variables that can only be matched against those of the other box at the initial set-up moment, their correlations are further restricted.


Quantum mechanics sits strictly between situations 2 and 3. The correlations shown by quantum-mechanical systems are beyond those allowed by local realism (i.e. they violate Bell inequalities) but they are less than you can obtain with an arbitrary non-signalling set of boxes (i.e. PR boxes). There is an entire hierarchy of nonlocal correlations in the space between 2 and 3, with different experimental predictions, and so far every measurement has been consistent with quantum mechanics. The question of why exactly this is the case, particularly when confronted with the many (human-perceived?) eccentricities of quantum mechanics, is at present still open.
