Ideally, people enter the health care system at the lowest level that can adequately treat them. Primary care is at a lower level and cost than is specialty care. Specialty care is at a lower level and cost than inpatient care. By getting care in the lowest level setting, costs are kept lower.
Cost is an important factor.
The costs of running an ER include 24-hour staffing with highly trained doctors and nurses and technicians and expensive diagnostic and treatment equipment. Many insurance companies will no longer pay for a visit to the emergency room unless it is an absolute emergency. They wouldn't pay for an earache to be treated in an emergency room, for example. They will probably end up in the emergency room for care that could have been provided in a doctor's office or a clinic. Timing is another important factor.