The 2022-23 offseason has seen a significant rise in 10-year plus contracts in the MLB. The decade-long contract is a regular occurrence and is fast becoming a trend in the league. To attract star talent, teams are now offering players lucrative long-term deals that will secure their futures. There may, however, be another reason behind the strategy.
Baseball technically does not have a salary cap. It does, however, have an MLB luxury tax that regulates team spending. To limit their yearly payroll spending (on paper atleast), teams are dragging out these contracts over a longer period. MLB analyst Pedro Moura touched on the subject:
"Think of it as more of a tax-avoidance strategy than a strict plan to rely on the player at 40."

Moura's recent FOX Sports article discusses in detail the benefits of long-term deals for teams that face massive luxury tax fees.
"Cot's has the Mets with a total 2023 payroll bill of $495 million at the moment ($384m in player pay + $111m in luxury tax). Yes, that's a record" - Travis Sawchik
The New York Mets will have to play approximately $111 million in just projected luxury tax in 2023. This comes after a historic spending spree this offseason. Owner Steve Cohen invested over $800 million in numerous long-term agreements.
Clubs are shattering their previous contract records at both monetary value and contract length.
MLB saw a record number of 10-year plus contracts this offseason

Historically, teams have avoided gambling on longer deals that risk the club's future. There have been cases in the past though. Bryce Harper secured a 13-year, $330 million deal in 2019. Harper's deal, however, will come to an end when he is 39 years old. Teams are now investing in players that will cross the 40-years-old mark by the end of their contracts.
"The New York #Mets 2023 payroll under owner Steve Cohen is now a cool $377 million, nearly $100 million more than the biggest total in #MLB history, with Carlos Correa pivoting from the #SFGiants to the Mets with his 12-year, $315 million contract." - Bob Nightengale
Trea Turner and Xander Bogaerts recently signed deals that will commit them to the Philadelphia Phillies and the San Diego Padres. Both players will be in their 40's upon the completion of the contract. Carlos Correa will be 39-years-old at the end of his contract with the New York Mets.
These organizations will most likely not expect players to perform at a high level into their late 30's and 40's. Decade long-deals do provide teams with an alternative way of securing star talent and limiting the damage to their payrolls.