Start here. This is the direct spoken answer to practice first.
Overview
A response model controls what crosses the HTTP boundary, not just what appears in Swagger UI.
A FastAPI response model validates the value returned by the handler, converts it into the declared output shape, serializes supported values, and filters fields that are not part of that shape. FastAPI also uses it to generate the response schema in OpenAPI. If application code accidentally returns an internal object containing a password hash, an explicit public response model can exclude that field. This is runtime boundary processing, whereas a Python return annotation by itself is mainly information for tools.