Deleting files.
There are 2 kinds of file system links. Hardlinks and Symbolic links
A Symbolic Link (sometimes called a symlink) is from one perspective similar to a macOS Alias (there are a differences, but for this discussion that is its closest relative on the Mac). The symbolic link is a file that contains file path information to the real file. That is to say if you have /Applications/Utilities/Terminal.app as the file, you might create a symbolic link in a different directory that stores the string "/Applications/Utilities/Terminal.app" as the contents of the symbolic link, and the file system knows to read that string and open the real file. The file system knows to look for that string because the file type is Symbolic Link (vs Regular File, vs Directory, vs Block Device, vs Raw Device, vs FIFO (aka a named pipe), etc...).
If the real file is deleted, the symbolic link is orphaned, in that there is no longer a real file to be opened. But if you later create a new file at that location with the exact same file name, the symbolic link will again find a file to open. This is how a macOS Alias behaves as well.
NOTE: A symbolic link is a low level file system abstraction. A macOS Alias is a GUI framework abstraction. Generally speaking a symbolic link is accessible to every programs and process running. An Alias is really only available to GUI applications that use the GUI framework to access files.
A Hardlink is a 2nd (3rd, 4th, ...) directory entry that contains a file name (does not need to be the same name as the other file), and an internal file system file identifier. In the Unix world this is called the "inode" number. The inode is how the file system finds the metadata for a file, where the metadata is things like time stamps, file size, owner, group, permissions, and what blocks of storage contain the data for the file.
Anytime a file system hardlink is created, the file system increments a reference count on the file. In the Unix world this is called the "nlink" count.
When a file is deleted, the file system removes the filename from the specified directory and decremented the nlink value. If the nlink value goes to zero after it is decremented, then the file system will mark the file for deletion. If the nlink count is greater than zero, then it means there is 1 or more other hardlinks in some directory within the file system that is pointing at the file's inode.
I say marked for deletion, because if the file is open and by macOS, then the file will not be deleted until it is closed for the last time (as in it could be concurrently open by several processes).
My day jobs is as a Unix file system developer, which I've done for several not-Apple Fortune 500 companies.