This is because gravity is pulling the baseball down but very little is affecting the balls forward motion. Gravity is a force that acts only on objects with mass. As you know from Newton's 2nd Law, forces cause objects to accelerate or change their velocity with time. However, if you wish to look at motion in two dimensions such as the flight of an arrow or a fly ball you must remember one simple fact.
Gravity ONLY works vertically or in the y direction.
Gravity does not pull things sideways, it only pulls them down. Separating the x and y parts of an objects velocity is not difficult. Consider a simple right triangle. This is the time it takes the ball to reach the highest point. Now we can find the height using equation 3.