If one side fouls, but the other side has the advantage, the referee will raise his hand indicating he saw the foul, but not blow the whistle to stop play.
If the advantage is lost quickly, the referee may enforce the penalty. If play has gone on, he may not ever stop play.
That prevents a player from fouling just to disrupt the play.