PayPal is spending billions on M&A to throttle the heightened competition it faces from the likes of Square and Stripe.

In the past few weeks alone, PayPal has likely spent well over $3 billion on acquisitions, based on disclosed and undisclosed terms. PayPal plans to spend $2.2 billion on mobile point of sale company iZettle to head off Square's expansion in Europe and $400 million for Hyperwallet to enhance PayPal's ability to offer mass payouts globally. Both deals are expected to close before the end of the year.

Those aren't its only investments. In May, PayPal and the Singapore investment fund Temasek made a joint investment in New Delhi-based Pine Labs. The same week, PayPal announced it would acquire Jetlore, a Silicon Valley startup that uses artificial intelligence to produce personalized marketing. PayPal has additionally disclosed plans to spend between up to $3 billion in each of the next three to five years on acquisitions.

For all of that money, PayPal needs to get a return with lucrative clients, a global footprint, and flexible merchant technology that can be expanded even more via PayPal's Braintree development tools.

Hyperwallet will give PayPal multiple disbursement options and an existing roster of clients that includes Home Away, Expedia and Stella & Dot. Historically, eBay served as an effective client acquisition channel for PayPal as eBay — which owned PayPal from 2002 to 2015 — required sellers to open a PayPal account before selling items on the eBay platform. eBay has already announced plans to shift that volume to Adyen.

"eBay's decision to intermediate its payments when their operating agreement expires in a couple of years could reduce the new account openings form this relationship," said Thomas McCrohan, an analyst at Mizuho Payments. "Firms like Hyperwallet have relationships with other platform companies by helping these platforms facilitate payments to sellers."

In discussing the pending Hyperwallet deal, Braintree general manager Juan Benitez said the use cases from combining this technology are almost limitless.

And when added to earlier PayPal acquisitions such as mobile payment technology company Paydiant and cross-border payment gateway Xoom, PayPal's umbrella covers a global user base of 270 million with a workflow that stretches from digital shopping to social networking. It also includes AI-driven location-based marketing tied to single-click checkout on both the merchant and consumer side of the transaction. The scope of PayPal's technology gives it an advantage over most fintechs, which typically focus on only consumers or only merchants.

"PayPal is the Amazon of the payments space," said Richard Crone, a payments consultant. "Their business models are similar, but PayPal is more closely tied to payments."

Both companies serve a two-sided market and leverage a consumer base while serving merchants with e-commerce services, Crone said.

"All of these [acquired services] go together to integrate promotional offers from product manufacturers and consumer product goods, and PayPal will redefine the payments space the way Amazon is redefining retail with the Whole Foods acquisition, Amazon Go, etc.," Crone said.

Much of PayPal's strategy is built on the success of another major acquisition, which PayPal made almost five years ago. In the fall of 2013 it spent $800 million to acquire Braintree in what's likely one of the better investments any financial technology company has ever made.

Braintree's open technology tools have helped PayPal reach third-party developers and build necessary relationships to keep pace with Square and Stripe. Braintree has improved checkout as PayPal separated from eBay, extended single-click checkout and provided technology to streamline e-commerce shopping to avoid cart abandonment.

Braintree has given PayPal inroads into providing payments for the sharing economy through collaborations with Facebook, Pinterest and UnionPay. Braintree also operates Venmo, the P2P app that, while struggling to reach profitability on its own, gives PayPal a popular social payment tool to enhance its attractiveness to retailers by combining shopping with social networking.

Braintree's influence has helped PayPal grow its user base, improve its financial performance and reach a solid stock valuation—giving it funds for more acquisitions.

"Both Amazon and PayPal have a high stock valuation and investors that believe they can build the next big thing, so the Street has given them a currency, which is a high stock price, the latitude to invest and innovate," Crone said.