Both "public_html" and "htdocs" is a specific type of folder which the hosting company use for us to publish our files. Only those folder will set the permission for us to read and write, and for our visitors to browse the contents as webpages in the browser. There are also some common name for this like "wwwroot", "http_docs" and sometimes they use both as one is a replicate of another one.