It's really about planning. Modern Swiss towns mostly consist of high density buildings with parking underground and most of the areas around the buildings are for walking & biking. The really good thing about high density is that it allows for much more efficient public transport which reduces the need for cars.