If a defender fouls an attacking player in the penalty area and the ball is in play anywhere on the field it can be called a penalty kick.
Refs often miss those either because they're looking elsewhere or they decide the contact or foul was trifling and not worth stopping play for.