Most cities in Germany have 2-3 primary "subway" systems, one operated by the national railroad company, and the other usually municipal.
Above that the national railroad operates regional trains (RB, RE), express trains (IC and ICE).
IC and ICE is what you would take from Stuttgart to Frankfurt.
RB, RE is what you would take from Stuttgart to some surrounding town like Tübingen.
Then there's the S-Bahn, U-Bahn and Strassenbahn (not always), which are the somewhat local trains.
The S-Bahn usually comes every 30 mins (but often multiple trains on the same line lead you to have enough selection for a 10 minute wait in the city) and fans far out (~30-50km in many cities), but often it's the fastest local train. The stops are about 2-5km apart.
The U-Bahn is more local and doesn't fan out as far, usually goes every 10min and has stops every km.
The Strassenbahn stops every 500m-1km and is above ground (so not technically a subway), also this doesn't exist in all the major cities.
I was referring to the S-Bahn. For me it's my city train service, It's the closest station and takes 10 min to downtown with a train running roughly every 10min. I can take it far out of town as well.
I'm putting all three in the same pool because you usually buy a single ticket valid for S-Bahn + municipal transport (U-Bahn, Strassenbahn and Buses).
The S-Bahn is both a primary subway for many people and it goes far out like some commuter trains in NYC.