A model is a file that groups all the operations for one type of data. The user model handles everything about users — creating accounts, checking passwords, verifying emails. The note model would handle creating, updating, and deleting notes.
You could write database queries directly in your route's action or loader. But as your app grows, the same operation (like "find user by email") gets used in multiple places — signup, login, password reset. A model gives that logic one home so you don't repeat yourself. Developers call this principle DRY — Don't Repeat Yourself.
Routes handle HTTP (forms, redirects, responses). Models handle data (queries, validation, business rules). Routes call models, not the other way around.
Route (action/loader) → Model → Database
This is the same separation you saw in Chapter 4: the route decides when something happens (e.g. "when the login form is submitted"), the model decides how to carry it out (e.g. "look up the user by email, compare the hashed password, return the result").