An employee stocks salad mixes in the produce department of a Kroger supermarket in Peoria, Illinois.

Competition for technology is a major driver in the surge of mergers and acquisitions in 2018.

Four out of 10 acquisitions of technology companies have come from companies in other industries, PricewaterhouseCoopers' deals team said in their mid-year review and outlook released Thursday.

The consumer and retail industry has made the most purchases of tech companies, accounting for 32 percent of cross-sector deals involving tech, the report said.

Share of tech acquisitions by non-tech firms, 2018

Source: PwC

For example, Nordstrom announced in March it bought two digital retail start-ups: a sales communications platform called BevyUp and a brands-to-customer texting service called MessageYes.

In media, Gannett said in May that it has agreed to buy cloud-based digital marketing company WordStream for $130 million.

The focus on buying tech firms comes as companies overall are increasingly interested in deals in other industries. One-third of megadeals this year have crossed sector lines, the PwC report said.

"Looking ahead, we can expect to see more – and larger – convergence deals, continuing the blurring of industry lines," Curt Moldenhauer, PwC's U.S. deals solutions leader and China inbound deals leader, said in a emailed statement to CNBC.

Mergers and acquisitions overall are on the rise. The bidding war for 21st Century Fox assets picked up after a federal judge cleared the way last week for AT&T to buy Time Warner for $85 billion.

The number of deals larger than $5 billion so far this year is on track to double last year's total, PwC said, citing its analysis of Thomson Reuters data. Overall deal value is up by more than 50 percent, the report said.

The analysts cited rising oil prices, U.S. tax reform and the U.S. approval of the AT&T-Time Warner tie-up as positive drivers for further mergers and acquisitions.

But the most important factor is the record amount of capital companies have on hand to make purchases, the report said. "It's likely here to stay for the foreseeable future and will eclipse all other economic variables influencing deal values through the rest of 2018 and beyond."