1- We had a terrible night. The baby wouldn't go to sleep.
2- I was late for work today because my car wouldn't start.
3- The CD wasn’t working so I brought it back to the shop but they wouldn’t give me my money back because they said the box had already been opened.
I suppose I can use "didn't" instead of "wouldn't" in these sentences.
I don't understand the logic of using "would" in these kind of situations. What kind of difference do we convey when we use "would" instead of "did" in these situations?