Spaghetti is made of semolina or flour and water. Italian dried spaghetti is made from durum wheat semolina, however; outside of Italy, it can be made a variety of different ways. Thin spaghetti in tomato sauce dates back to 19th century Naples. Classically, the sauce was served with fatty meats like ham, sausage, and bacon; meatballs were not served with the dish commonly until World War II in America of all places.
A fun origin fact is that on April 1, 1957, BBC made a spoof broadcast convincing everyone that spaghetti grew on trees. At that time spaghetti was considered an exotic delicacy and BBC played on that fact by going into much (facetious) detail about how frost could impair the flavor of spaghetti and that spaghetti strings always grow to the same length. Bonus fact about this television presentation: some people believe it was the first time the television was used to stage an April Fools joke.