Merging the consumer health businesses of GlaxoSmithKline and Pfizer will help GSK invest more heavily in its pharmaceutical and vaccine development, GSK CEO Emma Walmsley told CNBC on Wednesday.

Earlier, GSK and Pfizer said they will combine their consumer health portfolios, which include brands like ChapStick, Tums, and Nicorette, into the largest producer of over-the-counter drugs. Combined, the units generated $12.7 billion in revenue last year. The two companies plan to close the deal in the second half of 2019 and spin off the joint venture sometime within three years.

GSK will hold a 68 percent stake in the joint venture, while Pfizer will hold the rest. Over-the-counter products typically give pharmaceutical companies steady revenue streams, whereas name-brand prescription drugs can be a volatile business when they lose their patent exclusivity.

"This opportunity is truly a unique one in an all-equity deal to create the world's leading over-the-counter drugs company, a leading consumer health-care company with significant value creation for shareholders," Walmsley said in a "Squawk Box" interview. "But it also allows us to strengthen our number one priority, our pharma pipeline."

Walsmley said the consumer business will still help GSK with cash flow but merging it with Pfizer's consumer unit will create a company with "significant" scale that can focus on only consumer. Meantime, GSK can keep investing in pharmaceuticals and vaccines.

In March, GSK bought Novartis out of its stake in their consumer health venture. Now with the Pfizer deal, London-based GSK expects to save 500 million pounds (about $632 million) by 2022 for expected total cash costs of 900 million pounds and noncash charges of 300 million pounds. The company plans to reinvest up to 25 percent of the cost savings from the deal into the company's innovation efforts.

Walmsley took the helm in April 2017 and has since promised to reinvigorate the company. Investors have soured as other manufacturers have built robust pipelines of pharmaceutical products while GSK's has lagged. She hired Dr. a new chief scientific officer, Hal Barron, who formerly led research and development at Alphabet's Calico.

In July, GSK announced plans to invest $300 million in consumer genetics company 23andMe and form a four-year collaboration to discover medicines using 23andMe's database collected from its at-home DNA tests. And earlier this month GSK said it would buy Tesaro, a company with a number of cancer treatments in its pipeline, for $5.1 billion.