Complex sentence: Pingcheng became the capital of Northern Wei from 398 AD until 494 AD, when the well-known Yungang Grottoes were constructed during the later part of this period (460--494 AD).
Split into simpler sentences: Pingcheng became the capital of Northern Wei from 398 AD until 494 AD. The well-known Yungang Grottoes were constructed during the later part of this period (460--494 AD).