The NFL has a hard cap and non-guaranteed contracts. Only the signing bonuses are guaranteed. So when an NFL team cuts a player, only the bonus left to be 'payed' (the rules allow the one time bonus to be spread over the length of the contract to keep one time cap hits down) effects the cap.
The NBA has a soft cap and guaranteed contracts. That means the teams agree to pay the entire contract amount when it is signed.