In the early days of baseball, home runs over the fence were rare. The baseball was much less lively and the outfields were huge and far away. So the few home runs that were hit were usually the inside the park variety.
The first recorded home run in Major League history was hit by Ezra Sutton of the Cleveland Forest Citys of the National Association on May 8, 1871. Sutton hit another home run that day. Ross Barnes, who played for the Cicgao White Stockings, now the Chicago Cubs, hit the first National League home run on May 2, 1876. It is not recorded whether any of these first home runs were over the fence or not.
Players back then were not trying to hit the ball out of the park. First, because the fences were to far away and second, because this was the dead ball era. The baseball was simply not lively enough. Add to that the fact that during this time, a ball caught on one bounce was still an out.
"Small Ball" as we call it now was played. Slap hitting, moving runners, bunting, manufacturing runs. Also, pitchers were allowed to spit on the ball, rub tobacco juice on it, scuff it up and dirty it to the point that it wasn't as easy for the batter to see the ball.
After World War 1, these rules changed and so did the baseball. Now the pitchers were prohibited from spitting on the ball or putting any foreign substance on it. Dirty baseballs were replaced with new ones. The ball itself was now cork centered and much livelier.
Babe Ruth took advantage of this in 1920, when he literally changed the game by hitting 54 home runs. That total was more than all but one Major League team.
Now hitters all over baseball were giving up small ball for the glamorous home run.
Baseball was now becoming very popular and owners realized that more outfield seating would bring more revenue. So they added bleachers and seat in the outfield which shrank the size of the field making the fences more reachable.
One rule in effect then, was the rule that stated that a home run had to be fair when "last seen by the umpire". Many home runs were dis-allowed because the umpire said he didn;t "see it" land behind the fence. This rule was eventually changed. It is estimated that Babe Ruth may have lost as many as 50 home runs during his carreer because of this rule. Although until 1931, a ball that bounced over the fence was still considered a home run.
Another rule back then was that a walk off home run would only count for as many bases as need to force in the winning run. So, let's say there was a runner on third when you hit your walk off. It only took a single to drive in the winning run so that's what you would get credit for.