[fen "7k/8/4n3/2b5/3p4/8/2N1N3/3Q3K w - - 0 1"]
This picture above depicts a very simplified situation when white pieces threaten and black pieces defend the black pawn. If the next move is to white, it is a series of captures that is coming.
How does one decide if that is good for black or not? Is there an algorithm for that? How long will this series of exchanges take? Until all black and white pieces are consumed, or is there a point when the exchanges should be stopped?