When you buy a business asset, you normally get capital allowances over 8 years. So, if you bought two machines four years ago for €5,000 each, the tax written down value (TWDV) (the cost less the capital allowances to date) would be €2,500 each (€5,000 - 625 -625-625-625).
Now, if you sell machine A for €4,000 you will have a balancing charge to reclaim the "excess" allowances. The balancing charge is calculated as follows:
sales proceeds: €4,000
Less
TWDV €2,500
Balancing charge €1,500
This balancing charge is subject to tax.
If machine B is scrapped (no proceeds) you get an additional balancing allowance, which is treated as a normal capital allowance. The balancing allowance will be the difference between the TWDV and the proceeds (if any) and so, in this case will be €2,500.