The 737 was basically created to be Boeing's regional jet, but ended up growing into something larger to meet customer demand.
The DC-9 was introduced in 1965 and had variants seating from 90 to 135 in a single class. The 727-100 was introduced around the same time and already covered the upper end of this range. The 727-200 was even larger, almost comparable to a modern 737, so it wasn't really a "regional jet" as we would describe it today, and didn't compete directly with the DC-9. Boeing was looking for something to supplement the larger 727 and better cover lower capacities.
The 737-100 was introduced in 1968. It was designed to be low enough to the ground to allow built-in air stairs and for ground crew to be able to load/unload baggage without equipment. The capacity of 103-118 in a single class placed it right in the middle of the DC-9 market, but the DC-9 and other competition already had a head start. Only 30 of these were built, mostly for Lufthansa. The 737-200 was introduced to meet customer demand for something larger, seating 115 to 130 in a single class. This covers the upper range of the DC-9 family, and over 1,000 of these were built, surpassing the DC-9. These variants were even powered by some of the same variants of the Pratt & Whitney JT8D that the DC-9 used. It carried slightly fewer passengers than a 727-100 but was much lighter and with only 2 engines would have been cheaper to operate. With a gravel kit it could operate even on unpaved runways, and a few examples are still flying for this reason.
The 737-500 was the Classic version that was introduced in 1987 to replace the 737-200, and almost 400 of these were built. The 737-600 was the Next Generation version to replace the 737-500. The 737 had grown to optimally carry more passengers, and only 69 were built. The last 737-600 was built in 2006, with some orders being converted to the slightly larger 737-700. The smallest 737 MAX is the -7, which is slightly larger than the -700, and has not sold very well.
While the 737 NG was ramping up, Boeing did produce what began as the McDonnell Douglas MD-95 under the Boeing 717 name, but production ended amid slow sales. When the market for this size of plane picked up again, Boeing decided not to compete with companies such as Bombardier and Embraer in the regional jet market, as that would probably require a completely new design.