I drove through South Africa from Cape Town to Mozambique and noticed that almost all heights and mountains were no higher than approx 200-400 meters and had a flat top, just like the iconic Table Mountain. Why is this the case? Thanks.
I suspect you are referring to the mesas and buttes dotted around the Karoo - the large semi-arid plateau that makes up much of South Africa's interior. These are a product of the glacial and geological history of the region. The flat hills are capped by hard, resistant dolerite. This is solidified lava that was forced between the horizontal strata of the sedimentary rocks (which make up most of the Karoos geology) through high pressure. The dolerite erodes much slower than the surrounding rock and forms a flat cap above the underlying rock.
Most South African mountains are actually not like this - Google "Drakensberg" and you will see that the country's most prominent and highest mountain range is far from flat and short!
At least speaking for Table Mountain, from when I was at the top, it is actually not as flat as it appears from the surrounding landscape.
Table Mountain was formed from horizontal layers of sedimentary deposits. One hypothesis is that a collision between Africa and another oceanic plate occurred around 250 million years ago. The collision upheaved these layers. The apparent flat appearance of the top of the mountain probably reflects the original sedimentary layers. We see further evidence of this same collision, in the form of the Cape Fold Belt system, which stretches deep into the interior, for 700 km east and 200 km north of Cape Town.
Today, the mountain is composed of sandstone, which eroded into the shape we see today. This is similar to the shape of a flat clay river bank, without any plant growth, that is eroded by water.
The same phenomenon is probably responsible for the geological features, that make the entire Cape region so spectacular.
I'm not sure how related this is to what you saw in Mozambique.