There are a variety of ways that contractors can be paid. It all depends on the language in the initial construction contract.
For instance, some contractors are paid through cost-plus contracts. They keep a record of their actual costs, such as materials and labor hours, and establish fees to allow the construction company to make a profit on the job. This is a relatively transparent payment model, where both sides know exactly why compensation is being provided, but it does mean there could be some flexibility in the total cost of the project.
Another option is a fixed-fee contract. There is not any flexibility when it comes to payment, as there is a predetermined price for the project. The contractor agrees to do the entire job for a set amount of money. That means both sides need to run the numbers in advance to see what type of payment is appropriate since it cannot be changed.
The importance of detailed contracts
Having a detailed contract can help ensure that all parties are aware of their financial obligations and responsibilities upfront. This helps to avoid miscommunication.
For instance, if a general contractor believes that the client is going to cover the cost of parts and materials, but the client thinks that the contractor is going to purchase them and has built that cost into their price, there can be significant conflicts. Addressing this upfront can help avoid them.
That said, disputes or conflicts over contractual obligations are common in this industry. It is important for those involved to understand exactly what legal steps to take if there is a dispute.

