sudo because you need to elevate your privileges in order to modify a protected file owned by root.
macOS is based on Unix, and Unix started life as a multi-user, time-sharing system, frequently used in Universities, where protecting the system and other users from the students was essential.
These security protections have helped make Unix operating systems much more secure over the years, than many personal computers where the operating system assumed 1 user and that user was in total control (also the personal computer operating systems started life before networking and the concept of malware.
So sudo (Super User Do) is a way to elevate your privileges so that you act as the root user which has very few restrictions placed on what root can do. In this case edit and modify a file owned by root stored in a directory also owned by root.
I assume you already know what /etc/fstab is doing. And if not, then the VikingOSX "man fstab" pointer would have provided context for that.
WARNING - the sudo command is both very powerful and very dangerous unless you know what you are doing or are very lucky. If you are just following instructions from the web, you should be extremely careful as A) the person writing the instructions may have a different environment from yours, and the commands that worked for them, may not work for you, and B) if you mistype a command, it could have devastating results.
So when playing with commands like sudo, you should make sure you have backups, very recent backups. I've been using Unix since '85 and my current system has Time Machine backups, Carbon Copy Cloner backups, and an rsync backup to different attached external disks, and a Synology NAS server. I take protecting my data very seriously.
And even as an experienced Unix user, I've made mistakes in scripts that have done things like delete the /etc directory and made my system unbootable. So even experienced users can screw up.