They really didn't. Again, look at the structure of his contract and not the actual final totals.
Miller's deal has $45 million in guaranteed dollars paid in the form of signing bonus, roster bonus, guaranteed salaries for 2022-2024. The Bills will hae paid him $52 million in cash by the end of the third year of that contract. They can then cut him and save nearly $15 million in cap space with a small one year dead money hit of $7 million.
The reason why the contract looks so big when you see 6 years, $120 million is those last three years all carry massive base salary charges - $17 million, $19 million and then $29 million. But none of those are guaranteed. The Bills have zero payment obligations after 2024. For all intents and purposes, what Miller signed was a 3 year, $52 million (or so) contract.