A player may run forward with the ball, but may pass it only backwards or sideways. A pass that goes forward is a forward pass.
A pass is judged by the movement of the ball, not the hands. A ball thrown straight with a moving runner may still go forward.
Players can still move forward with the ball, so passing backwards is natural.
A knock-on happens when a player loses control of the ball and it goes forward and touches the ground or another player. The usual result of a forward pass or a knock-on is a scrum for the other team.
A knock-on is also when a player hits the ball forward with the hand or arm.
No knock-on happens if the ball goes backwards or sideways, or if the player catches it again before it touches the ground.
Deliberately knocking the ball on is a penalty offence, not just a scrum.
A deliberate knock-on gives the other team a penalty kick. If it stops a probable try, a yellow card can follow.
Example
A scrum-half's pass travels slightly forward. The referee whistles, and the other team gets a scrum at the same place.