Foldable device prototypes were publicly demonstrated in 2013. It took five years for the technologies required to enable foldable devices to become mature enough to ship bad products. It took another five years for them to mature enough to meet Apple's scale and quality requirements.
This isn't a "moonshot" (which take decades to build), but hardware innovations like this regularly take a decade to properly productize.