The first one allows visitors to access a route at yourwebsite.com/public. The files for this route are located on the server in a folder at the __dirname + '/public'
This means if you have a file named index.html located on the server at __dirname + '/public', a visitor would access the file at yourwebsite.com/public/index.html.
The second one allows visitors to access files at the root of your yourwebsite.com even though the files are stored on the server at __dirname + '/public'.
This means if you have a file named index.html located on the server at __dirname + '/public', a visitor would access the file at yourwebsite.com/index.html.