The Massachusetts Legislature is deep in its biennial crunch, scrambling to finish major bills by Sunday’s deadline. That’s the last day of formal lawmaking for the two-year session, and it means the next few days are make-or-break for multi-billion dollar spending bills, tax relief plans, cannabis industry reforms and more. Here are some of the things you need to know to understand what lawmakers are up to.

Gun laws, mental health and sports betting are all on the to-do list.

Each session, the July 31 deadline motivates the House and Senate to reconcile competing bills. The closer the end of formal sessions get, the more pressure there is to find common ground, or risk having to start all over again in January.

Still bottled up in House-Senate negotiations are bills to legalize sports betting, expand access to mental health care, overhaul governance at the state’s two soldiers’ homes, support equity in the cannabis industry and make billions of dollars available for transportation and environmental infrastructure.

A conference committee of three senators and three representatives kicked off talks Tuesday to reconcile different House and Senate versions of bills intended to spur economic development with more than $4 billion in surplus tax revenues, federal COVID-19 relief funds and bond authorizations. Those bills are also the vehicle for about $1 billion in tax relief, including one-time $250 rebates for some taxpayers.

In June, sweeping U.S. Supreme Court rulings added abortion and gun licensing to the Legislature’s late-session agenda. A conference committee reached a deal Monday on a bill creating new legal protections for abortion providers and their patients, and the chambers sent it to Gov. Charlie Baker Tuesday afternoon. The House added language into a court system infrastructure bill that would update the state’s gun laws to comply with the New York State Rifle & Pistol Association v. Bruen decision — which hasn’t come up in the Senate yet.

There will be surprises, too.

The gun licensing amendment is a good example of one typical end-of-session phenomenon: other policies suddenly get tacked onto spending and borrowing bills to make sure they get to the governor. The House also added language regulating law enforcement’s use of facial technology to that same judiciary infrastructure bill, and senators will likely have more amendments in mind when they take up that bill.

And as the deadline nears, bills that have been languishing for months will quietly and unexpectedly emerge for votes. For instance, the House on Tuesday advanced bills calling for the study of a Black heritage museum in Springfield and allowing provisional licenses for speech-language pathologists.

Most of the action happens behind the scenes.

The conference committees that work out compromises do so privately, and they typically don’t telegraph in advance how close they are to a deal — or how far apart they remain. It’s a hurry-up-and-wait dynamic this week on Beacon Hill, as legislative leaders craft their schedules one day at a time while waiting to see if compromises will be ready for a vote.

Bills written by conference committees can’t be amended, and as July winds down, the window often shrinks between when the final bill is filed and when lawmakers vote on it. Under the Legislature’s rules, conference committees have to report out their bill by 8 p.m. the night before a vote, but legislators can suspend that rule — allowing for quicker votes but leaving legislators and the public little time to learn details of sometimes massive bills. Last Thursday, a conference committee on climate and energy policy filed its 96-page compromise at 12:21 a.m., and both the House and Senate had agreed to it by 5 p.m. that same day.

Gov. Baker gets the last word.

When Baker gets a bill, he has 10 days to sign it, veto it, or send it back with an amendment. The deadline for Baker to act on this year’s $52.7 billion state budget is Friday, and he has until Sunday to decide on the climate bill.

For the bills still floating through the legislative process, Baker’s decisions will likely come after formal sessions end Sunday. Because Democrats have supermajorities in both the House and the Senate, they can usually still pass policies into law even if the Republican governor objects by overriding his vetoes. But after Sunday, they won’t be able to take an override vote, so Baker has the final say on any bills passed at the last minute.

Lawmakers take that into their calculations — mindful of a Baker veto on a 2020 abortion law, the negotiators who hashed out this session’s reproductive rights bill said they were striving for language he wouldn’t object to.

It’s not necessarily the end.

Beacon Hill’s attention will largely turn to the campaign trail in August, but the Legislature will keep meeting twice a week. The difference is that those meetings will be sparsely attended informal sessions where any one lawmaker’s objection can halt a bill’s progress, unanimous approval is needed to advance a bill and recorded votes can’t be taken.

Bills can and still will pass — especially ones that respond to emerging issues. In December 2016, the House and Senate used informal sessions to rewrite the marijuana legalization law voters approved in that November’s election.

If Baker chooses to send a bill back with an amendment, lawmakers can keep working on that, too, in informal sessions. In 2018, bills involving short-term rental regulations, consumer protections from data breaches and civics education were all finalized months after Baker returned them with amendments in early August.

Here’s a thought to take away: the final days of July on Beacon Hill are like a college campus where all the cool kids are scrambling to hand in their big projects at the last minute humanly possible.