Usually, the most natural solution to cannot delete files is by dragging them to the Trash. Usually, they are 'ghost files.' You can't delete such files because they are not there in the first place. These could be music, documents, or a folder. It is thus a security measure for the program with regards to copyright restrictions. You might have wanted to delete the data accidentally.
It prevents the disruption of your ongoing work.
When deleted, their absence can cause your Mac OS to 'break.' It might not even be able to boot up. Your Mac system locks the file: Mac locks sensitive system files that are a must for its operations.