Main lines evolve over time as chess theory advances. A sequence of moves that was considered the main line decades ago may be supplanted by a new idea or refutation. Chess databases and engine analysis continuously reshape what is considered the main line in each opening.
Playing the main line has advantages and risks. The advantage is that you are playing moves proven to be sound by extensive testing at the highest levels. The risk is that well-prepared opponents will know the theory deeply and may have prepared improvements or novelties specifically targeting the main line.
For practical purposes, knowing the main lines of your openings provides a solid foundation. Even if you choose to deviate with a sideline, understanding the main line helps you evaluate whether your deviation is sound and what concessions you are making by stepping off the main path.