Updated
The cable can hold back a good charger: if it isn't rated for the power needed, your phone or laptop charges more slowly.
A standard USB-C cable carries 3A, which is at most 60W at 20V, enough for any phone. Above 60W a laptop needs a 5A cable with an e-marker chip: 100W, or 240W for EPR cables.
A cable rated above your charger does no harm; it just costs a little more.
1–1.5m suits a desk socket or a bag; 2–3m suits a bedside table or a sofa. A good cable delivers its rated power over its whole length.
Most cables fail at the neck of the connector. A braided jacket and solid strain relief at the ends help, as does not yanking the cable or bending it sharply next to the plug.
iPhone 11–14 have a Lightning port, so they need a USB-C to Lightning cable, ideally Apple MFi-certified, to fast charge from a USB-C charger.