This was a key question for the founders.
In short, the founders sat down and tried to determine which governmental activities were best done collectively by all the states and which were best left to be done individually by the states.
So, as an example, it would be unwise for each state to have their own military but a collective military would be more efficient and able to respond to the needs that emerged.