This is one of the toughest questions in baseball. But to answer it, we have to look much deeper into the game of baseball itself.
In baseball, there are 4 main components. Those components are:
They are the main four categories of stats. Batting and pitching are obviously more important than baserunning and fielding, so I won't count those.
In a game of baseball, the main goal is to score as many runs as possible. That sentence alone makes you want to lean to the hitting side, but before you do that, let me explain why you shouldn't judge your decision off of that statement.
A pitcher's goal is to let up as few runs as possible, and if they do their job well and hold the opponent to no runs, their team will likely win because their team will likely score a run. In 2019, the average number of runs allowed in a game was 4.83. That means that in general, if pitchers hold their opponent to 3 runs or fewer, their team will likely win. And because good batting is bound to be on every team and good pitching isn't, that makes pitching more important.
But is one part of the game truly better than other parts of the game? I don't think so, and that's why batting and pitching are tied for importance.