The number of passing yards lost to penalties is found by calculating how many passing yards a team accumulated on a given play, and subtracting any penalty yards tacked onto the end.
If a quarterback successfully completes a 50 yard pass, but holding is called on one of the lineman, the play will more than likely be called back (the non-penalized team has the option of going to the next down at the spot of the foul, or repeating the down; coaches always choose the latter). In this example, passing yards lost to penalties would be 50 yards. It is easy to see why having a low number of passing yards lost to penalties is essential to the success of every football team.
Having fewer penalties in general is the best option, but when a team knows on which plays they commit the most penalties, and can quantify it, combating the problem becomes easier.