There are multiple reasons for an illegal touching penalty, a 5 yard offense: 1) A forward pass is caught by an illegible receiver such as an offensive lineman. 2) On a forward pass, the receiver steps out of bounds and doesn't re-establish himself in bounds before catching the pass.
Per the NFL's operations website:
ARTICLE 8. ILLEGAL TOUCHING OF A FORWARD PASS
It is a foul for illegal touching if a forward pass (legal or illegal), thrown from behind the line of scrimmage:
- is first touched intentionally or is caught by an originally ineligible offensive player; or
Penalty: Loss of five yards.
- first touches or is caught by an eligible receiver who has gone out of bounds, either of his own volition or by being legally forced out of bounds, and has re-established himself inbounds.
Penalty: Loss of down.
Note 1: If a forward pass (legal or illegal) is caught by an ineligible offensive player, the ball remains alive.
Note 2: The bat of a pass in flight by any player does not end a pass, nor does it change the impetus if the bat sends it in touch.
Note 3: If a player touches the ball after having been out of bounds, but prior to re-establishing himself inbounds with both feet or any part of his body other than his hands, the pass is incomplete, and there is no penalty for illegal touching.