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.
3) On special teams, when a player from the kicking team touches the ball prior to it travelling 10 yards.
1) If the ball is tipped by a defender prior to the offensive lineman catching the ball it is not deemed to be illegal touching
2) If the player voluntarily goes out of bounds, they are no longer able to compete in the play. This is to prevent a player from running through the bench, security personal, etc. in order to get open in bounds. If the player is pushed or shoved out of bounds they must re-enter field of play with both feet to re-establish themselves as an eligible receiver. For this to happen the officials must deem that the player was shoved out.
3) The exception in this instance of an onside kick is if the receiving team touches the ball inside the 10 yards, after this point it is considered to be a live ball.