Is there a difference in enforcement if the holding penalty happened after and not before a pass? This is NFL if it makes a difference.
Yes. Most defensive fouls on eligible receivers, most commonly "illegal contact", are only penalized prior to the pass being thrown. From NFL Rules 2020, 8.4.7:
If the quarterback or the receiver of the snap demonstrates no further intention to pass the ball (i.e., hands off or pitches the ball to another player, throws a forward or backward pass, loses possession of the ball by a muff that touches the ground or a fumble, or if he is tackled) the restrictions on the defensive team prohibiting illegal contact, or an illegal cut block, against an eligible receiver will end, and a defensive player is permitted to use his hands, arms, or body to push, pull, or ward off an offensive receiver, pursuant to Rule 12, Section 1, Article 5.
Illegal contact, further, is not penalized if the quarterback leaves the pocket, though defensive holding still is.
If the quarterback leaves the pocket area with the ball in his possession, the restrictions on illegal contact and an illegal cut block both end, but the restriction on defensive holding remains in effect.
As such, Defensive Holding is "prior to the pass", and Illegal Contact is "prior to the quarterback leaving the pocket" or "prior to the pass" depending on if the quarterback left the pocket or not.
As a side note, neither foul actually requires a pass being thrown; it is very common for a sack or a scramble to occur on plays which have a defensive holding or illegal contact play being called. It simply requires it being legal for the quarterback to pass, and that he did not clearly abandon passing by his actions.
I'm not sure if it's technically possible to have defensive holding after the ball is thrown (except on an interception), but if it were it would have a very different set of rules; most of the cases that would qualify as defensive holding prior to the pass being thrown are either legal or become (the usually more serious) defensive pass interference.