These are two completely different cooperation models between clients and software development companies.
The fixed-price model is an agreement for a predetermined sum of money for which the service provider is obliged to complete the project. Simply put, the client and software house establish the final price for the project before the project begins. The fixed-price contract is a good solution, especially for MVPs and small projects with clearly defined scope and requirements.
On the other hand, in a time-and-materials (T&M) contract, the client is charged for working hours spent on the software project. It means that the final price for the project is not predetermined. The time-and-materials model is ideal for large and complex software projects, as it gives much greater flexibility and the possibility for introducing adjustments and changes on the go.