Notepad is a plain text editor which comes with WIndows.
Notepad can't / doesn't shutdown the computer. In the exampled linked in the post above, Notepad is used to create .bat file (batch file) which includes the windows "shutdown" command; when the .bat file is executed (or opened by the double click) the command in the batch file is executed and the computer shutdown. The .bat file shuts the system down not Notepad.
Windows .bat (batch) files are just files which contain a list of commands which are executed one after another when the .bat file is executed. (MacOS script files are equivalent.) Windows .bat files (and MacOS scripts) can include some simple programming features which can make the .bat file do more complex tasks. .bat files are widely used to simplify carrying out frequently performed tasks (which need a sequence of native/basic commands to be executed).
If you were using two computers for HW, then if you had a network connection between them, then one of the computers could send commands to the other machine to make it (for example) shutdown. This would probably require some programming which be possible in a .bat or a MacOS script.
Iain