Foreign keys are constraints that link a column in one table to a column in another table, ensuring that a value can be added to the first only if it already exists in the second. They help maintain referential integrity across databases and prevent errors by preventing operations with invalid data. In SQL, foreign key rules can be set when creating tables, and actions for handling updates or deletions can also be specified. Foreign keys are crucial in establishing relationships between tables and ensuring consistency within a database.