Cap was 71.4 million in 15-16.
Oilers notable salary for that season was
Hall + Eberle + RNH = 18
Schultz = $3
Fayne = $3.5
Ference = $3.2
Nikitin = 4.5
Pouliot = 4
Yakupov = 2.5
Draisaitl = 0.925
Nurse = 0.925
Purcell = 4
Sekera = 5.5
McDavid = 0.925
Talbot = 4
That's about $55 mill in salary give or take, they were in a very comfortable position cap wise. Even the "bad contracts" only had limited term on them (ie: Nikitin was expiring that year, so was Purcell, and Purcell was traded no fuss).
The Leafs actually were in a worse position cap wise, they had the Clarkson contract, which is far worse than any contract the Oilers had and also Kessel was hard to move because of his contract so they had to retain money on that.
When all was said and done in 2015-16, the Oilers had $2.6m in cap space and that's after they sold on guys like Purcell and Schultz. The 'bad contracts' that carried over into the following years were Fayne, Ference, Pouliot--and Korpikoski, who had to be bought out to free up additional cap for the next season's payroll--a sign that there wasn't as much cap to go around as you seem to think.
The biggest part of the cap situation isn't even about the 'bad contracts'. It's about how that money was allocated and for how long. They had their 'Hall and Eberle' contracts--players they could not afford to keep long-term--mainly JVR, Bozak and Komarov since Kessel was traded prior to the Leafs drafting Auston Matthews. So was Dion Phaneuf--so you should probably note that the gears were already well in motion
prior to the team acquiring their franchise player. Auston Matthews, Mitch Marner and William Nylander all played their first full NHL seasons in 2016.
When we move farther down the rosters, the Leafs had Bozak, Kadri, Komarov, Gardiner, Reilly--a quality supporting cast locked into team-favorable deals. Their roster had the support to shelter the younger players from hard match-ups out of the gate. Our team had none of that. Andrej Sekera was our one true support on defense--and he played on the same side of the ice as our two raw defensemen.
Look even further down the rosters and there are little gems like Zach Hyman and Connor Brown ready to take on key roles. Meanwhile we're struggling to get anything out of our farm system. Even the little call-ups they made showed well in the short periods they played.
I can't stress how much better a situation the Leafs were in when they drafted Auston Matthews. Their 'dead cap' was literally all LTIR--ours were active players taking up roster spots.