There are basically two reasons that cause Mac to delete files immediately without saving them to Trash:
1. Using Delete Immediately feature on Mac
2. Trash file permission error
Usually, if you press Option + Command + Delete keys or use the File > Delete Immediately option in the Finder menu, Mac will directly delete files by skipping the Trash. The best way to avoid this issue is to stop using the access. Instead, you should drag files to the Trash and then empty them from the Trash when you are 100% sure that you don't need these files again.
Further, to stop Mac trash from deleting files immediately, you can follow the below methods:
1. Always try to move files to the Trash instead of pressing Option + Command + Delete or "Delete Immediately" option on the quick access.
2. If the removed files were not saved to Mac Trash but deleted immediately due to a file permission issue, the Terminal command prompt is a good way to solve the problem.
3. Mac Trash has a similar feature as Windows Recycle Bin which can be set to remove items from the Trash after 30 days. To enable this feature, you can go to Finder > Preference > Advanced > Uncheck "Remove items from the Trash after 30 days". To prevent you delete the wrong files, you should also check "Show warning before emptying the Trash" in Finder Preference.
Hope it helps!