Foreign keys in SQL are attributes that establish relationships between tables by referencing the primary key of another table, ensuring referential integrity and enforcing constraints to maintain data consistency across related records. They play a crucial role in defining relationships and maintaining data accuracy in relational databases.