It’s basically to prevent “goal hanging” (players hanging around the opposition’s goalkeeper). It’s quite a simple rule. What makes it contentious is being able to tell if the player receiving the ball was behind all of the opposition’s defence players at the exact time the ball was kicked to them. Hence the introduction of VAR to digitally do what the official linesmen do (those officials running up and down the side of the pitch).
Other main rules include “fouls” I.e. impeding another player - the severity of which leads to either a yellow card (a warning, but get two of those during a match and you’re off the pitch) or a red card (bad or dangerous foul) and you’re instantly sent off. Fouls committed in the penalty box area lead to a penalty.
You also can’t handle the ball hence it’s called football 😁