What does resistance do in an electric circuit?

It controls the amount of current that flows. A dead short (wires without resistance) would cause too much current to flow and overheat the wires.