Somewhere between “the salary cap is a myth” and “the salary cap keeps teams from keeping good players” is the truth.
The NFL uses the salary cap primarily as an accounting tool to keep teams in line with each other and encourage parity. Every dollar paid to a player must be accounted against the cap somehow. The creativity comes with the ability to decide when that happens.
The use of bonuses has long been a tool to spread cap hits out. Recently, teams have started using void years in contracts to do the same.