Shari Redstone got her wish.

After more than a decade apart, CBS and Viacom, both under her control, agreed to merge on Tuesday in a deal that will reunite a roster of once-mighty media businesses. Viacom’s Paramount film studio and MTV and Nickelodeon cable networks will be added to the broadcast giant CBS and the book publisher Simon & Schuster.

The deal will allow the company to invest more in streaming, which is the future of entertainment. CBS already has a thriving digital television service with original series, including the forthcoming “Star Trek: Picard,” and Viacom owns an ad-supported streaming service called Pluto TV.

With the merger, CBS’s digital service could see the addition of children’s content from Nickelodeon, and Pluto TV could include some of CBS’s ad-driven digital networks like its 24-hour sports news service CBS Sports HQ. The companies can also negotiate for better terms with pay-TV operators, which could make cable bills more expensive.

The combination of CBS and Viacom is a victory for Ms. Redstone, the leader of a family business that has led the two media giants for two decades. The two companies were once a single entity, called Viacom, until they were split up in 2006, and their reunification was seen as necessary at a time when television audiences have eroded. Tech platforms like YouTube, Instagram and Netflix have chipped away at big media, eating into the once-fat profits that companies like CBS and Viacom reaped.