What happens if I directly add the `<li>` without adding the `<ul>`?

I noticed that creating a list using “li” tags but without the “ul” tag still results in a listed format. But I also found that adding the “ul” tag results in the list becoming indented, while removing it causes the list to appear flush left. So is the function of the “ul” tag more a visual organizer, like “div”, or a formatting tool? Or both? (If someone could also explain how to format a comment so the tags appear properly, I would appreciate it! Can’t seem to figure that out).