Japan was closed to the outside world for 300 years from the early 1600s through the late 1800s. Without the knowledge of the European alphabet, the concept of algebra was not introduced until the country was opened for trade. A unique counting and analytical method called 和算 "wa-san" (which literally means Japanese math) was developed in this period. It is a visual tool to describe everything from basic addition to complicated physics. The students learn how to apply the tool in 1st grade and develop their own system.
Line diagram is a simple way to visually describe the relationship between changing values. Younger students adapt to this method easily and learn to apply it to solve complex problems as they develop analytical skills. The students learn to visualize the solution and draw it to organize their thinking. They learn how to use the known values to find an unknown value through understanding the relationship of the values. There is no one right way to do this. Line diagrams help them develop their own thinking skills.
We often hear "why do I have to study math?". Many mathematical concepts taught at school may not seem to have practical applications for vast majority of students. Conventionally, math is taught as a fact, name, notation, or usage. Japanese math teaches realistic mathematics that enables students to make sense of formal math. When the simplest form of math is progression in a logical order and the problem situation is experientially real to the students (such as painting a wall or planting a tree), the question is no longer "why do I do it" but "how should I do it". We start with what the final outcome would look like and figure out what knowledge and tools are required to reach the outcome.