A schema is the agreed shape of a dataset: its column names, their types, and which of them may be blank.
Schema enforcement checks that shape before anything else, because row rules mean little if the columns are wrong.
It protects every later step from structural surprises, such as a missing column or an unexpected new one.
Databases apply schema on write: the table defines the columns, and an insert that does not fit is refused.
CSV and JSON files carry no schema of their own, so the reading code must check their structure itself.
That approach is called schema on read, because the structure is interpreted only when the data is used.
A typical check confirms each expected column exists, has the expected type, and has no blanks where none are allowed.
It also decides what happens to unexpected extra columns, either ignoring them or stopping to ask.
Schema drift is the slow change of a source's structure over time, through renamed, added or retyped columns.
Drift caught early costs a quick fix, while drift caught late means repairing weeks of stored data.
Some changes are safe, such as a new optional column, while others break readers, such as a renamed or removed one.
Teams often write the schema down as a contract with the source team, and update it by agreement when it changes.
Some file formats store a schema inside the file, which makes these checks easier than with plain CSV.
In practice enforcement runs first when data is loaded, followed by validation rules on the rows that pass.
The usual mistake is letting the reading code adapt silently, so a renamed column turns into blanks nobody notices.