California senators were deep in heated debate about a small but politically explosive attachment to the state budget last week when a Riverside Democrat could be heard to suddenly channel Forrest Gump.

“Trailer bills,” said Sen. Richard Roth—referring to pieces of legislation tied to the budget but sometimes bearing little connection to it—“are a box of chocolates. And you never know what you’re going to get.”

Surprises abound each year as lawmakers craft the annual budget that keeps the state running. While most of the budget involves big-ticket items such as how much to spend on public education ($74.5 billion) or health care for the poor ($105.6 billion), a few extra nuggets are always thrown in that don’t involve much money but make significant policy changes.

Some of the surprising morsels this year include bills to revamp the timeline for recalling a politician, expand the pool of people prohibited from owning guns and give unions the chance to talk to newly-hired government employees. To California’s Democratic-controlled statehouse, these trailer bills are the caramels, buttercreams and raspberry truffles that sweeten the budget deal.

“This is how you reach agreement,” said Assembly Budget Committee Chairman Phil Ting, a San Francisco Democrat. He noted that the budget and its accompanying trailers involve months of negotiations among the Senate, Assembly and Gov. Jerry Brown.

“You find a way to have agreement with all of those three parties, and that’s really what this budget reflects,” Ting said.

Of course, what is a sweet treat to Democrats is often bitter to Republicans, who found these extra pieces of lawmaking tough to swallow. Many in the GOP, which lacks enough seats in the Legislature to block the trailers, say they allow Democrats in the majority to fast-track new policies without normal vetting. Trailers skip the policy committees that regular bills must clear, can’t be overturned by voters via referendum, and take effect immediately upon being signed by the governor. Regular bills run the risk of being put on the ballot to be overturned by voters and take immediate effect only if passed by a two-thirds supermajority.

Budget trailers, because of a ballot measure voters approved in 2010, require just a simple majority to pass.

“It’s an easy path to getting policy changed,” said Fred Silva, fiscal policy advisor for the think tank California Forward.

Silva worked in the Legislature for nearly 20 years and helped write state budgets in the 1980s and ‘90s. He said the use of trailer bills exploded after voters passed Proposition 13 in 1978. That’s because Prop. 13 drastically changed the state’s fiscal relationship with school districts and counties, complicating the art of crafting a state budget.

Now, the use of trailer bills ebbs and flows with the economy. Lawmakers write more of them when the state’s fortunes are down and fewer when times are flush, ranging from 61 trailer bills in 2004 to 16 passed so far this year—with more still in the works.

But whether the budget is packaged with a small or large assortment of trailer bills, a few always spark bitter debate. Take the bill changing recall rules that prompted Sen. Roth to use the chocolate box analogy. It’s a play by Democrats to thwart a recall campaign targeting of one of their own: Sen. Josh Newman of Fullerton. He’s had a target on his back since last year when he narrowly won a seat held by Republicans; they launched the effort to recall him after he voted this spring for the gas tax.

“We are here for a budget. We are not here for a political campaign,” Republican Assemblyman Jim Patterson of Fresno said as the bill was being debated.

Or look at a gun-control provision tucked into the public safety trailer. It expands the categories of people prohibited from owning firearms to include some who have been accused of crimes but not yet convicted. The policy is California Democrats’ way of responding to a recent move by the Trump Administration that made it easier for people accused of certain crimes to buy a gun. While Republicans complained the trailer bill move was sneaky, Democrats said it simply returned California firearm policy back to where it was before the federal government loosened things up.

So can the Legislature throw almost anything into a trailer bill? Yes, according to court decisions— it just has to be connected in some way to the budget.

“Issues associated with the budget can run from the micro to the macro,” said H.D. Palmer, spokesman for Brown’s Department of Finance.

He recalled past years when budgets involved huge changes such as abolishing urban redevelopment agencies and shifting low-level criminals out of state prisons and into local supervision. And Palmer dismissed the argument that policy changes don’t belong in budget trailers, insisting “there is a very powerful case to be made that the single most important policy bill in any given year is the state budget.”

In past years, some trailer bills were written hours before lawmakers voted on them, prompting complaints about the lack of transparency. But because voters approved Proposition 54 last year, all bills must now be in print three days before lawmakers vote. So the budget passed this month marked the first time that lawmakers—and the public—had a few days to chew on the full array of chocolates.