The city borders of Paris are, of course, essentially defined by history like most other city borders in Europe. Paris’ situation is in no way unique; see for example the City of Brussels which houses only 14.6 % of the inhabitants of the Brussels Capital region (the corresponding number for Paris seems to be around 17.5 %).
The question of why a certain municipality did or did not merge with a number of surrounding villages typically depends on how the country in question handles local government. In France, going down from the Republic at-large there are regions, départements and ultimately cities/towns/villages. Most of the Paris urban area is in the region Île de France which is made up of multiple départements; one of these (number 75) is the city of Paris (or traditionally Seine as per its location in the alphabetical index). Interestingly, this département used to be larger (and contain multiple municipalities) but was split into four départements (Hauts-de-Seine, Seine-Saint-Denis and Val-de-Marne alongside Paris proper) in 1968. I suspect that the central government did not want too much of an imbalance between the main city/département and the areas surrounding it; and maybe also population distributions or importance of départements/regions on a national level was a concern.
In Germany, the cities of Berlin and Hamburg were enlarged in the interwar period by national laws. After the Second World War, many of the original state boundaries (or province boundaries in case of the provinces of Prussia which was dissolved) were kept and the new German states would, where possible, be made up of entire former states. Some boundaries have shifted, some states have merged but Hamburg and Berlin remained unchanged. However, they (and Bremen) are special municipalities in that they themselves are at the level of a state. This means, the mayors of Hamburg, Bremen and Berlin are equal in rank to the minister presidents of e.g. Bavaria and North-Rhine Westfalia but above the mayors of e.g. Munich or Cologne. The city government has state-level and municipality-level duties but I believe some of them are delegated to borough governments.
Munich is larger than Bremen (but smaller than Hamburg and Berlin), yet it is fully contained within the state of Bavaria whose capital it is. Cologne, the fourth-largest city in Germany is part of North-Rhine Westfalia but not the state capital. These two cities (and many, many others) are still special in that they are not contained in a Landkreis (a regional governing area like English counties or French départements); they are Kreis-free cities. However, this still puts them on the same level as much smaller Kreis-free cities such as Kaufbeuren.
With respect to Munich, the Bavarian state is divided into regions (Regierungsbezirke) and it was recently discussed whether Munich should become its own region (it is currently in the region of Upper Bavaria). However, that discussion seems to be going nowhere. Other large cities of Germany are probably going to stay where they are and even a merger of Bremen and the surrouding state of Lower Saxony (i.e. the opposite direction; but making sense considering how much smaller Bremen is) is probably not going to happen any time soon.