Note: this ended up turning into a much bigger research project than anticipated and is not meant as a dig at anyone but just general observations about the previous 4 cup winners and their cap structure
-----
The actual factor that matters is that each of these teams had a large set of players making under $1MMish who outperformed their contracts, thus allowing them to pay and retain their star players and make it all fit under the cap, and, when replaceable players want to get paid they don't pony up and let them walk.
STL:
Sundqvist Barbashev Thomas Blais Sanford Dunn Fabbri all under $1MM. This group alone produced 13 goals 14 assists 37 points in the playoffs for a combined total of $5.53MM.
Jordan Binnington made $650k and gave them 16 wins.
Maroon at 1.75MM and got them 3G 4A in playoffs. Only eggregious contract is the Steen one @$5.375MM, and that didn't prevent them from retaining any of their core players.
WSH:
Last year of a sweetheart $4MM John Carlson deal pretty critical to their cup, but they had fantastic playoff contributions from Wilson ($2MM) Vrana ($863K) Connolly ($1.5MM) Smith-Pelly ($650k) Stephenson ($650k) Kempny ($900k). 25 goals, 27 assists, 52 points in the playoffs for just shy of $6MM.
One bad contract in Orpik's $4.9MM.
PIT:
For both years it was a mix of Sub $1MM players in Sheary Rust Guentzel Kunhakl Dumoulin Cullen, cheap Schultz ($1.4MM, $1.9MM), paying $650k a year for 2 Matt Murray cup runs, and the $1.9MM Bonino (LOL).
No egregious contracts that prevented them from retaining their high end players.
_______________
Many of these teams did have to let a couple pieces of their cup team go because of cap constraints, but they replaced them with cheap fungible depth guys, case in point: Washington not paying Jay Beagle a "thank you for your service" contract and replacing him with Nic Dowd at 25% the cost. Also: Letting Smith-Pelly walk, Getting a 2nd and 3rd for Burakovsky and giving that opportunity to Vrana who is thriving.
STL let Maroon walk and replaced him internally.
Penguins seem to just constantly call up guys who have had their names randomly generated these days and plug them right into the system when half their team goes down to injury and they just win a bunch of games anways.