It’s the law when operating a motor vehicle, to have a DL. If it’s just a stop, you could get a warning, or ticket that can be waived by showing your license in court.
You must accurately identify yourself, if questioned by a LEO. If you give the wrong name, you can be arrested immediately.
You need ID to prove you’re of age to by certain drugs, or enter certain places.
When traveling, one needs ID to cross certain borders. Or certain types of ID, like a passport…