Yeah of course the cost of staff is included in the budget; paying people to build things is the primary cost of development. The average gamedev salary in the USA is $80k -- so salaries for 100 staff over two years is $16 million! As well as tools / services, etc, there's also all the boring stuff like renting an office, paying the power/internet/cleaning bills, keeping the fridge stocked with milk, etc... All up, 100 staff over 2 years (and the tools / facilities to allow them to work) probably costs more like $24 million.
The over-budget situation depends on the contract that's in place. Usually publishers don't pay developers $20M up front in one big cheque and then hope for the best. Instead, most contracts are based on "milestone" payments. At the beginning of the project when the budget/design is being approved, the plan will include what kind of progress will be made at different points in time. e.g. Month 3 - character can roam a test level will all abilities, Month 6 - AI combat is complete, Month 9 - Level 6 is completed in full as a "vertical slice" example of the finished product, Month 12 - a beta is released for testing, etc, etc...
The publisher will only release small portions of the funds as each milestone is achieved. If the developer is late in achieving a milestone, then they'll be late in getting paid for it. If the developer doesn't have large cash reserves, this might mean that they're unable to pay salaries for a month and all their staff quit and the developer goes bankrupt.
In other situations, the developer might be contractually obligated to deliver on their promises -- and if they don't (or are late), the publisher might sue them for damages and the developer goes bankrupt.
Yeah, there also might be some situations where the publisher has sunk so much money into a game already, that they agree to pour in even more money to help the developer catch up and actually finish the game... but it's probably more likely that they'd cut their losses and cancel the project.
Sometimes the publisher themselves might be contractually obligated to another entity. e.g. a publisher might have paid $1M to a sporting organization to secure the rights to product a game about that organization (NFL, NHL, FIFA, etc...)... This contract could specify that the publisher must release a game within a certain time-frame, or the contract is automatically cancelled. In that situation, if their developer was late, it would jeopardize their contract with the sports franchise, so they might feel pressured to release a buggy game early in order to fulfill their contract... and then they might sue the developer for failing to fulfil the other contract :lol:
However, since the global financial crisis (market crash of 07/08), the big publishers have dramatically reduced the amount of work-for-hire projects that they do with third-party developers. It used to be common for a large independent developer to work with a publisher in the manner outlined above... but these days, publishers tend to mostly work with developers that they actually own outright! In that situation, if the developer fucks up, they can just fire you or liquidate your whole office. They also might do that anyway even if you succeed in making a good game though! :lol: :(
FWIW I've worked (as a developer, not management) on 5 shipping console games and 6 cancelled console games -_-