The rule in question is the completed catch rule:
Article 3 Completed or Intercepted Pass. A player who makes a catch may advance the ball. A forward pass is complete (by
the offense) or intercepted (by the defense) if a player, who is inbounds:
(a) secures control of the ball in his hands or arms prior to the ball touching the ground; and
(b) touches the ground inbounds with both feet or with any part of his body other than his hands; and
(c) maintains control of the ball long enough, after (a) and (b) have been fulfilled, to enable him to perform any act
common to the game (i.e., maintaining control long enough to pitch it, pass it, advance with it, or avoid or ward off an
The section to pay attention to is C, the ruling is that he gained possession of the ball and maintained possession for long enough to advance it prior to breaking the plane of the end zone, this means soon as the tip of the ball cross the plane the play is over and anything that happens subsequently is irrelevant.
As for the common misconception that the ground can not cause a fumble that is an utter fabrication caused by TV commentators with insufficient knowledge of the rules of the game. If a player has possession of the ball and he goes to the ground in the field of play and contact between the ground and the players hand or the ground and the ball prior to the player being down by contact causes the ball to come lose it is a fumble.