In late 2015, HP was reborn as a PC maker following a split of its parent organisation, Hewlett-Packard.
At the time, HP was a lost cause, and its double-digit decline in PC shipments was a main reason for the split.
The new HP then set out to reclaim its spot as the world's top PC maker from Lenovo, a title it lost in 2013 - it reached the goal in the first quarter of 2017, during which its PC shipments grew by 13.1 percent year over year.
A series of cool products and decisions to cut off low-margin products helped HP return to the top. Lenovo's struggles also played a part, but the vendor's strong performance in North America was a deciding factor, IDC said.
To reach the top, HP took on an Apple-like role of being an innovator and focused on profitable products. At the same time, it cut products like its Slate PCs, some low-cost Stream laptops, TouchSmart all-in-ones, Omni PCs, and other devices that were key offerings in the past.
In December 2015, HP also cut low-cost tablets and Android devices, due to fierce competition and a drop in prices. Tablet demand was declining, and low-cost alternatives were available by the dozens.
"We saw the consumer tablet market as the opposite -- low-value being flooded with cheap devices with Shenzhen," said Ron Coughlin, president for personal systems at HP.
"We didn't think that would provide the customers or shareholders with the right value."
Armed with market research and engineering expertise, HP then set out to redesign its PCs into smaller and more attractive form factors.
Products such as 2-in-1s were designed to appeal to buyers like millennials, many of whom don't mind spending the extra buck for a device that looks sophisticated.
"We don't chase share for share's sake. We could have discounted our way to the share gains we had, but that wasn't our plan at all," Coughlin said.
"People wanted a smaller footprint, but they wanted the same power," Coughlin said.
HP also released the Pavilion Wave PC, a modern take on Apple's Mac Pro.
The company also reversed some of its past mistakes. It re-entered the high-end PC gaming market, which it exited when it folded the Voodoo PC unit in 2008.
Gaming PCs have been the bright spot in an otherwise slumping PC market, and in August, HP introduced a range of innovative high-end Omen gaming PCs, which had similar color tones to the Voodoo PCs.
The "high-value" Omen PCs are taking market share away from conventional gaming PC makers, and gaming is a profitable market, Coughlin said.
But it's the volume-selling products like the Pavilion, EliteBook, Spectre, and Envy that sold well and helped HP's market share grow. Many of the laptops are thinner, smaller and sleeker than older HP products, and 2-in-1 products are selling well.
With all of HP's success, it had some duds too. One questionable product was the Elite X3, a Windows 10 Mobile smartphone targeted at enterprise businesses. Windows 10 Mobile smartphone shipments are declining, and the OS could be on its last legs.
But for Coughlin, the Elite X3 is targeted at the commercial mobility market, which is underserved.
HP has pitched Elite X3 as a device that can be used as a PC in a pinch and can be used to run commercial applications via the cloud. Many organizations are already using it as a computing device, Coughlin said.
"In mobility, we aren't standing still. You'll see some exciting news coming out shortly," Coughlin said.
HP has no plans to enter the consumer mobile phone market, however.
"There's only one or two players that make money there," Coughlin said. "We thought that market wasn't important for us."
One market that's important to HP as it looks to grow its PC business is virtual reality. The company plans to start shipping its Omen X VR backpack PC starting in June, and by the end of the year, will ship a Windows Mixed Reality headset that needs to be tethered to PCs.
HP also plans to blend augmented reality into the PC in a different way than other vendors are. A PC like Sprout, with an attached 3D camera, will be a good "on ramp" for 3D, and HP's MultiJet Fusion 3D printer will manufacture tangible products, Coughlin said.
For example, the company will make it possible to build custom shoes using its PC, scanner, and a 3D printer technologies.
A Sprout-like PC will be able to scan a foot in a footbed with pressure plates. From the scan, HP's Jet Fusion 3D printer will be able to make the custom insole, and ultimately, whole shoes.
Looking into the future, Coughlin predicted vendors will sell "smart PCs" that can protect themselves and self-repair.
For example, a PC will be able to detect if a hard drive is failing and then fix it during computer downtime. More intelligence will be built into secure PCs, Coughlin said.
There will also be a move to the PC as a service, mostly targeted at enterprises. It will involve leasing instead of paying a full price for a device.
HP has exciting announcements coming in the future related to gaming, VR, and mobility, Coughlin said.
"We're mean, lean and focused. This company was founded on innovation," he said.