There are two factors involved that are similar, but not managed the same way.
1. Hospital Capacity: Economic shutdowns have been largely to manage Hospital capacity since if all the hospitals in an area are overwhelmed, the death toll will grow since patients suffering any kind of acute issue will have nowhere to turn
2. The spread of disease (COVID-19): This is what is trying to be controlled by encouraging people to perform effective steps to limit the spread (with a second-order effect of reducing demand on the hospital) -- that is, if less people get the disease, less people die from the disease, and we can get a vaccine program and have an overall lower casualty rate from COVID-19.
Both of these strategies do not have to be employed.
For example, in the case where there's no effective vaccine in the near future, it might make sense to simply ensure that everyone gets infected at a slow enough rate that Hospital Capacity is not critical. This is because with this pandemic, over a long enough timeline (and again, without an effective vaccine), everyone will get the disease eventually. So in this scenario you are simply concerned about managing hospital capacity, and your tools are masks, social distancing, and economic shutdowns -- no need to track the infection, etc. Some locales are using this approach, and shutting down hot-spots without too much focus on how the disease is spreading, but most developed countries are tracking the spread much more closely and can be more targeted with the guidance. This was likely the initial thinking of many people, and why a shutdown did not occur before disease had spread widely.
On the other hand, if you assume a compliant population a near total economic shutdown to for a short period of time, with strict social distancing and containment measure to ensure that there is no spread, along with no new individuals, and a strong track-trace policy, then you can eradicate the cases with minimal masks. This is basically what China did, as far as I understand it. This was the initial model other locales tried to implement when they went into "Lockdown"-mode, but were not as successful, also -- again, from my limited understanding as a lay person.
On a third hand, if we assume we are going to have an effective vaccine in the near future (which was FAR from certain when this whole thing played out) it makes more sense to do both in concert -- that is, primarily limit the total number of people infected (masks and social distancing; this is because the long term outcomes of people afflicted with COVID-19 are unknown, limit that unknown risk) with a secondary task of managing Hospital capacity to prevent things from becoming catastrophic. This is sort-of where most locales have landed at the moment: Mandate masks (slow the spread) and shutdown hot-spots as they are detected (manage hospital capacity).