Most countries have national id. USA doesn’t. In USA the driving license is accepted as photo id. It is required to be shown in many places from entering bars, to high rise office complexes (esp after 9/11), boarding flights, etc. If you are a foreigner then you can also show your home country driver license for age verification but for id you have to show your passport. It is similar in other countries too. They generally have national id card, driving license as photo-id, etc. I have used USA driving license as photo id to pick up congress passes

in Europe.
When travelling I usually don’t carry passport on me in person. I leave it in the safe at the hotel. It is more hassle if it gets stolen or lost on the streets.
Yet of all places in the world only once I was randomly stopped and asked for a passport. It was in Tokyo, Japan! It was near empty street and past midnight. Last place I worked have expected that to happen.
“You don’t have to carry it but show it when asked” is one of those classic bureaucratic rule making. I think it allows you to show it within reasonable time if you doing have it. If it is authorities they can either follow you home or all you to bring it next day.