As people got confused about this, here is the information given when this "rule" was changed:
In case of a foul inside the box/a penalty being awarded, the player who fouls the attacker while making a ‘fair and reasonable’ attempt to play the ball will only get a yellow card, whereas previously the player to concede the foul would have been sent off under the "triple-punishment" rule, which sanctioned the offence with a red card, suspension and a penalty kick.
So, in the new laws a player who commits a foul while tackling in a "fair and reasonable" attempt to play the ball will only receive a yellow card for this offence, because it is considered that the penalty kick recreates the goalscoring opportunity that was lost by the foul.
The difference is the foul is a penalty, there is no attempt to play the ball but also no attempt to foul the player.
It's a penalty no matter what but the colour of card is down to the referee whether he sees it as fair or reasonable.