The owner asks for bid security with the bid. A bid bond is the usual form. If the winning bidder walks away, the owner can claim against the bond.
Public projects often require a bid bond from the general contractor. Some general contractors also require one from large subcontractors.
Read the instructions to bidders for the required amount and form. Requirements differ by owner and by state, so check the bid documents. Ask your surety agent early. A bond request on bid day morning can miss the deadline.