It's commonly related how baseball derives from the English sport of Rounders, or from some specific early American game such as Old Cat, but the truth is rather more complex. America has a long tradition of safe-haven games, and baseball as we know it today is not simply a product of a single branch of the family. These games, collectively, were our national pastime before we had standardized the rules in a single form, and even before we could call ourselves a nation.
The notion developed in some derivative of stoolball, a sport we've discussed on this blog before, that players should be able to pause their running in a safe spot, adding an element of tactical decision making as well as speed. The result is bases, which allow players to decide whether to press their luck and push on ahead or stop and gain no immediate advantage but mitigate their risk. These are the safe havens from which the whole family of games gets the name used for it by modern folklorists. (It's a misleading name, as they're a feature absent in many members of the family, including the most popular one in the world.)
While today's American safe-haven games are basically limited to baseball and its close relatives softball and kickball, in colonial times there were a great variety. "Old Cat," for example, seems not to have developed the waiting-on-base feature and greatly resembles best-guess reconstructions of early stoolball. A single "striker" or batter hits the ball, and runs the basepath as many times as they can before being tagged out, scoring a point for each base touched along the way. (The number of bases was highly variable, but one aside from home seems to have been most common; in this, the game closely resembles modern stoolball rulesets or cricket.) The players, however numerous they are, take turns as striker, with each one playing in turn against all the others. If one must pick a primary ancestor of baseball, it is four-base Old Cat, which seems to have thoroughly informed the development of both town ball (a collective name for several baseball-like games played in the 19th century) and rounders (an English safe-haven game primarily played by children today). Other games existed in parallel with it, however, which may have influenced the development of the game we know. These more cricket-like games seem to have existed in the northeast (and in England) from the late seventeenth century and in many cases survived as folk sports into the twentieth.
Most significantly, town ball was created by the introduction of a full batting lineup, allowing the innovation where players were permitted to freeze on bases and permitting the idea of runs being batted in. As noted above, this adds a substantial element of tactical play to the game, and it spread like wildfire - but aside from the inclusion of this feature, the rules varied greatly. Sometimes pitches were overhand as today, but more often they were underhand as in slow-pitch softball. Various rules existed for how a runner could be called out; in many versions of the game, for example, throwing the ball so that it strikes a runner between bases counts as an out. The modern concept of tagging a base to keep the runner from stopping safely on it, on the other hand, seems to have been scarce until late in the nineteenth century.
As has previously been noted on this blog, the rules were standardized for professional play twice - once in New York and once in Massachussetts. These two versions were quite different. The features they have in common are also shared with rounders, suggesting continued contact and influence across the Atlantic during the nineteenth century. New York baseball featured many things we recognize today, such as the three-out inning, play to a fixed number of innings, and the requirement that the runner not stray outside the basepath; it is from these rules that baseball and softball are derived. Massachussetts town ball, however, offered several distinct features, such as the overhand pitch, that survive into the modern game; it is clear that the overall baseball community preferred the New York rules (despite certain enthusiasts insisting that the Massachussetts game was more interesting to spectators), but readily recognized the advantages which the other rules had to offer.
The result, of course, is a national sport which incorporates all of the best innovations America introduced to the sport family. Today, half the professional sports teams in North America play baseball, and more people attend live baseball games each year than go to see any other sport. While the distantly-related sport of cricket is more popular in the rest of the world, there are very few countries in which cricket has not been eclipsed by various forms of football; the American cousin, however, has adapted perfectly to the desires of its fans for the past two centuries and retained its top position.