The cap is the total amount of money a team can spend on player‘s wages (salaries, bonuses, dead cap space from cut players).
When a team signs a player to contract, his signing bonus gets spread over the life of the contract and is added to the amount of cap space he takes up each year (in addition to his salary, and any other bonuses). When he is cut, the left over amount of signing bonus is absorbed immediately into the cap space (versus being spread over the rest of the life of the contract if he weren’t cut). That’s where the idea of dead cap space comes from — when a player is cut, and the rest of his signing bonus counts against the cap (and cannot be used).
Cutting after a certain date (June 1) allows you to spread the dead space over two years, instead of one.
Often times contracts are structured such that the team can more easily cut the player and not take a huge dead cap hit before the contract ends.
Restructuring contracts by adding years, or converting roster bonuses to signing bonuses allows teams to manipulate how much a player counts against the cap.
This is the very basics of NFL contracts. I am not an expert.