If you use a good database system, foreign keys is an actual concept on the server that is used to enforce data integrity.
With database-level foreign keys, it becomes impossible to break your data by deleting data referenced by other data, without also dealing with the referenced data.
In practice this means that deleting a node from the database could be
as simple as
DELETE FROM node WHERE nid = 53 CASCADE, and conversely
it would not be…