Deel Interview Question

How does Postgres return data that is not the current one? Where does it keep the version I need?