Galileo was the first to use mathematics to analyse projectile motion. He considered that, rather than using the motion of the object as a whole, it could be split into the constituent vertical and horizontal components (note that they're independent of each other), and when added together as vectors, it produced the total velocity of the object. He realised that the only external force acting on this object is gravity, and would only influence the vertical motion of the object while the horizontal velocity of the object would sty constant. Both balls would experience the same acceleration due to gravity regardless of mass (this is assuming no resistance), and hence would reach the same height, and strike the ground at the same time (as would objects of different mass).
Didn't really understand it much, correct me if I'm wrong