I figure it's something like this ...
A file is a base inode plus none or more indirectly linked inodes plus none or more data blocks as explained
here. Its name(s) are contained in directory entries which point to the base inode; the base inode has a count of the number of such links. When a directory entry is removed the link count is decremented and the kernel checks the new number of links. If it is zero the kernel checks if any processes have the file open (this information is in kernel memory) and if it is zero the kernel deletes the file otherwise it waits for the process(es) to close the file and each time that happens it checks again to see if any processes have the file open (described
here). Presumably actually deleting the file means marking all its inodes as free.
What happens if there is a power failure while a file has no directory entries but is held open by one or more processes? There is no opportunity to delete it (as described above) but it is not accessible either. Presumably that is why it is good practice to run fsck after a power failure so this can be rectified.