When you click the build button, the game checks your inventory if you have the necessary materials. If you do, the game moves the materials from your inventory to the object you're building. This way with far fewer clicks, you can get to building whatever much faster. If the player doesn't have any matching resources in his inventory, the build button functions like normal.
Example:
The player has 4 planks in his inventory and is making a cabin. He clicks the 'build' button and all the planks in his inventory are instantly moved to the cabins' plank amount. With 8 wood blocks in his inventory now, he clicks build on the cabin again, but since the cabin only needs 5 wood blocks, it only takes 5 wood blocks from his inventory, leaving behind 3.
edit - this could also only happen when the player shift-clicks the build button, or clicks on a check box next to it and then hits build.