Assume you have one table defined as
create person (
p_id int PRIMARY KEY,
p_name char(20))
and another
create person_tasks (
task_id int,
p_id int)
you could insert multiple tasks for each person in person_tasks.
p_id is the primary key in person, which makes it is unique in that table
p_id is a foreign key in person_tasks, where it refers to p_id in table person.
If you try to change p_id in person, you will get this kind of error-messages if you have records in person_tasks, as this would break the reference.
Note that you have to define the foreign key constraint with a statement appropriated to your DBMS.
This kind of relationships is one of the most basic concepts of relational databases, an one of their most important features: if you do things (i.e. design your DB ) well, they avoid you to accidentally destroy relationships you create between data, they prevent you referring to non-existing data, etc.