Anyone who knows how a skeleton looks like knows that there are spaces between the ribs. However, why does it have gaps between them? Why isn’t it a single shell?
The gaps between each rib allow you to curve your chest. If it was a solid shell, you’d be forced to keep your chest perfectly straight, which would impact mobility. Evolutionary pressures preferred mobility over a “shell-like” protection.
Having a shell like protection wasn’t that necessary in most cases. Turtles needed the protection, but mammals have been doing just fine without it. Probably the flexibility helps too.
Shells are also heavy. If an deer had a shell, it wouldn’t be as fast. Also, the shell wouldn’t really help agains wolves, so that protection would come with a lot of downsides. I guess the only real benefit would be when humans are trying to stab the chest or sides of the deer with spears and arrows.
Tl;Dr: because bone is expensive.
But quickly, that’s how everything started out with exoskeletons. As time progressed, material moved outside the bone and the material even changed. The skeleton just housed the important bits and motivators moved outside.
Slowly skeletons stopped being built in some places due to mutation and chance. The areas that couldn’t survive being poked (like brains) would select for those that kept it, while the areas that could tolerate pokes (like abdomen and chest cavity) lost it.
Eventually you get to something near to a “least skeleton needed” state. We have enough bone to operate and protect us, and they even do double duty. Your bones aren’t just support and protection, it also houses red blood cell manufacturing.
The spaces between ribs provide flexibility and allow for expansion of the chest during breathing. This flexibility is crucial for the movement of the ribcage as it expands during inhalation and contracts during exhalation, enabling the lungs to fill with air. If the ribs were a closed shell, this movement would be restricted, making it difficult to breathe effectively.
The gaps are for muscles used to expand and contract the ribcage. The expansion and contraction causes the lungs to inflate and deflate = breathing.
The gaps keep you alive.