Here's an example;
Let's say the GRY on corporate bonds is 5% and the GRY on government bonds is 4.25%.
The GRY is the yield that you expect to get if you hold the bond until maturity. It is the yield that equates the price you pay for the bond with the PV of the coupons and the redemption payments.
Let's say the credit risk premium is 0.5% and the marketability risk premium is 0.25%. Together these explain the difference between the corporate and government bond yields.
Because there is credit risk, this means the bond could actually default. For example, you may not get all the coupons or all of the redemption payment.
So, even if you know you will hold the bond to redemption, you should not expect to achieve a return of 5%. You would expect to achieve something less than 5%.
Because the credit risk premium is 0.5%, you would expect to achieve, on average, a yield of 4.5%.
This is why the credit risk premium is deducted from the 5% GRY.
The marketability risk premium is an extra yield to compensate investors for problems they might experience in selling the bond due to marketability problems.
However, if you know you will hold the bond to redemption, you won't be selling it and won't have any of these problems. Therefore, we assume that we will achieve that extra 0.25% yield and so there is no reason to deduct it.
Hope this helps!