That's a bit handwavey. Experience plays a part here and I've at least never seen a scaling issue where the root cause is not some form of API latency.
Most of the raw HTML generation, rendering is done by frameworks and browsers respectively and they're pretty standard / efficient pieces of software.